Fix cert generation harder.
This commit is contained in:
parent
2c73e8f816
commit
764724748b
|
@ -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,
|
||||
|
|
|
@ -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"),
|
||||
|
|
Loading…
Reference in New Issue