X-Git-Url: https://v.licheni.net/stack/cam.git/blobdiff_plain/790d363eee564bdc08fc519696d8deb70c70bc3f..09eeaa8aa8624de64ea1860f79a3075dd1875c5f:/cam/ca.py diff --git a/cam/ca.py b/cam/ca.py index a19835f..0bf7fcf 100644 --- a/cam/ca.py +++ b/cam/ca.py @@ -160,7 +160,10 @@ class CA(object): expiry = cert.get_expiration_date() if expiry and expiry > time.time(): - log.warn('certificate is still valid, revoking previous version') + log.warn('certificate is still valid') + + if cert.exists(): + log.warn('revoking previous version') self.revoke(cert) log.info('generating new certificate %s', cert.name) @@ -169,7 +172,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']