#250 Add some textual information to generated certs and ignore it when generating metadata
Merged 7 years ago by puiterwijk. Opened 7 years ago by puiterwijk.
puiterwijk/ipsilon issue-237  into  master

file modified
+7 -1
@@ -21,7 +21,7 @@ 

          self.cert = os.path.join(self.path, '%s.pem' % prefix)

          self.subject = '/CN=%s' % subject

          command = ['openssl',

-                    'req', '-x509', '-batch', '-days', '1825',

+                    'req', '-x509', '-batch', '-days', '1825', '-text',

                     '-newkey', 'rsa:2048', '-nodes', '-subj', self.subject,

                     '-keyout', self.key, '-out', self.cert]

          proc = Popen(command)
@@ -37,6 +37,12 @@ 

          with open(self.cert, 'r') as f:

              cert = f.readlines()

  

+         # Find the beginning of the certificate

+         # This helps if the admin pointed us to a certificate that includes

+         # the OpenSSL textual representation (openssl x509 -text)

+         begin = cert.index('-----BEGIN CERTIFICATE-----\n')

+         cert = cert[begin:]

+ 

          # poor man stripping of BEGIN/END lines

          if cert[0] == '-----BEGIN CERTIFICATE-----\n':

              cert = cert[1:]

no initial comment

Commit 9e90ad0 fixes this pull-request

Pull-Request has been merged by puiterwijk@redhat.com

7 years ago