allow specifying nsCertType in config
authorale <ale@incal.net>
Sun, 29 Dec 2013 16:55:56 +0000 (16:55 +0000)
committerale <ale@incal.net>
Sun, 29 Dec 2013 16:55:56 +0000 (16:55 +0000)
cam/ca.py
cam/templates/ext_config

index a19835f..f8a202f 100644 (file)
--- a/cam/ca.py
+++ b/cam/ca.py
@@ -169,7 +169,7 @@ class CA(object):
             csr_file = os.path.join(tmpdir, '%s.csr' % cert.name)
             conf_file = os.path.join(tmpdir, '%s.conf' % cert.name)
             ext_file = os.path.join(tmpdir, '%s-ext.conf' % cert.name)
-            conf = {}
+            conf = {'usage': 'client, server'}
             conf.update(self.config)
             conf['cn'] = cert.cn
             conf['days'] = cert.days or self.config['default_days']
index 596e406..486c087 100644 (file)
@@ -1,5 +1,5 @@
 basicConstraints        = CA:false
-nsCertType              = client, server
+nsCertType              = %(usage)s
 keyUsage                = nonRepudiation, digitalSignature, keyEncipherment
 extendedKeyUsage        = clientAuth, serverAuth
 subjectKeyIdentifier    = hash