Revert "Clever way to generate random CommonName only once"

Yet Another Revert And Hopefully The Last One

This reverts commit 7b3f3d01.
parent 7b3f3d01
......@@ -34,7 +34,6 @@ import zc.buildout
import pkg_resources
import ConfigParser
import hashlib
import uuid
class Recipe(BaseSlapRecipe):
......@@ -322,16 +321,13 @@ class Recipe(BaseSlapRecipe):
certificate_authority_path=config['ca_dir']
)
def requestCertificateRandomName(self, name):
"""Add certificate to be generated, using 'name + random number' as Common
Name. If certificate already exists, it won't be regenerated.
"""
def requestCertificate(self, name):
hash = hashlib.sha512(name).hexdigest()
key = os.path.join(self.ca_private, hash + self.ca_key_ext)
certificate = os.path.join(self.ca_certs, hash + self.ca_crt_ext)
parser = ConfigParser.RawConfigParser()
parser.add_section('certificate')
parser.set('certificate', 'name', name + uuid.uuid1())
parser.set('certificate', 'name', name)
parser.set('certificate', 'key_file', key)
parser.set('certificate', 'certificate_file', certificate)
parser.write(open(os.path.join(self.ca_request_dir, hash), 'w'))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment