Fix cert generation harder.

This commit is contained in:
Aldo Cortesi 2012-02-27 15:59:29 +13:00
parent 2c73e8f816
commit 764724748b
2 changed files with 5 additions and 3 deletions

View File

@ -296,7 +296,7 @@ def dummy_cert(certdir, ca, commonname, sans):
ss = [] ss = []
for i, v in enumerate(sans): for i, v in enumerate(sans):
ss.append("DNS.%s = %s"%(i, v)) ss.append("DNS.%s = %s"%(i+1, v))
ss = "\n".join(ss) ss = "\n".join(ss)
f = open(confpath, "w") f = open(confpath, "w")
@ -338,7 +338,7 @@ def dummy_cert(certdir, ca, commonname, sans):
"-CA", ca, "-CA", ca,
"-CAcreateserial", "-CAcreateserial",
"-extfile", confpath, "-extfile", confpath,
"-extensions", "v3_cert", "-extensions", "v3_cert_req",
] ]
ret = subprocess.call( ret = subprocess.call(
cmd, cmd,

View File

@ -147,12 +147,14 @@ class udummy_cert(libpry.AutoTree):
cacert = os.path.join(d, "foo/cert.cnf") cacert = os.path.join(d, "foo/cert.cnf")
assert utils.dummy_ca(cacert) assert utils.dummy_ca(cacert)
p = utils.dummy_cert( p = utils.dummy_cert(
os.path.join(d, "foo"), #os.path.join(d, "foo"),
"/tmp",
cacert, cacert,
"foo.com", "foo.com",
["one.com", "two.com", "*.three.com"] ["one.com", "two.com", "*.three.com"]
) )
assert os.path.exists(p) assert os.path.exists(p)
# Short-circuit # Short-circuit
assert utils.dummy_cert( assert utils.dummy_cert(
os.path.join(d, "foo"), os.path.join(d, "foo"),