Generate random CommonName

parent 94075309
...@@ -2,6 +2,7 @@ import os ...@@ -2,6 +2,7 @@ import os
import subprocess import subprocess
import time import time
import ConfigParser import ConfigParser
import uuid
def popenCommunicate(command_list, input=None): def popenCommunicate(command_list, input=None):
...@@ -42,9 +43,9 @@ class CertificateAuthority: ...@@ -42,9 +43,9 @@ class CertificateAuthority:
try: try:
# no CA, let us create new one # no CA, let us create new one
popenCommunicate([self.openssl_binary, 'req', '-nodes', '-config', popenCommunicate([self.openssl_binary, 'req', '-nodes', '-config',
self.openssl_configuration, '-new', '-x509', '-extensions', self.openssl_configuration, '-new', '-x509', '-extensions', 'v3_ca',
'v3_ca', '-keyout', self.key, '-out', self.certificate, '-keyout', self.key, '-out', self.certificate, '-days', '10950'],
'-days', '10950'], 'Automatic Certificate Authority\n') 'Automatic Certificate Authority %s\n' % uuid.uuid1())
except: except:
try: try:
for f in file_list: for f in file_list:
......
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