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 = []
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)
f = open(confpath, "w")
@ -338,7 +338,7 @@ def dummy_cert(certdir, ca, commonname, sans):
"-CA", ca,
"-CAcreateserial",
"-extfile", confpath,
"-extensions", "v3_cert",
"-extensions", "v3_cert_req",
]
ret = subprocess.call(
cmd,

View File

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