Commit 225885d2 authored by Antoine Catton's avatar Antoine Catton

Don't regenerate ssl keys every buildout run

parent 87e32328
......@@ -110,10 +110,13 @@ class Recipe(BaseSlapRecipe):
def createCertificate(self, size=1024, subject='/C=FR/L=Marcq-en-Baroeul/O=Nexedi'):
key_file = os.path.join(self.etc_directory, 'httpd.key')
self.path_list.append(key_file)
certificate_file = os.path.join(self.etc_directory, 'httpd.crt')
self.path_list.append(certificate_file)
files = [key_file, certificate_file, ]
if not all([os.path.exists(f) for f in files]):
for f in files:
if os.path.exists(f):
os.unlink(f)
subprocess.check_call([self.options['openssl_binary'],
'req', '-x509', '-nodes',
......@@ -122,5 +125,6 @@ class Recipe(BaseSlapRecipe):
'-out', certificate_file,
'-keyout', key_file
])
return dict(key=key_file,
certificate=certificate_file)
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