Fix problems with SANs and certificate generation.

This commit is contained in:
Aldo Cortesi 2012-02-27 15:36:19 +13:00
parent 2ba8296843
commit 2c73e8f816
2 changed files with 10 additions and 1 deletions

View File

@ -27,6 +27,7 @@ nsCertType = server
basicConstraints = CA:false
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
nsCertType = server
%(altnames)s
[ alt_names ]
%(sans)s

View File

@ -300,7 +300,15 @@ def dummy_cert(certdir, ca, commonname, sans):
ss = "\n".join(ss)
f = open(confpath, "w")
f.write(template%(dict(commonname=commonname, sans=ss)))
f.write(
template%(
dict(
commonname=commonname,
sans=ss,
altnames="subjectAltName = @alt_names" if ss else ""
)
)
)
f.close()
if ca: