@@ -127,6 +127,10 @@ def createSslRsaCert(self):
127127 "/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Domain Validation Secure Server CA"
128128 ]
129129 self .openssl_env ['CN' ] = random .choice (self .fakedomains )
130+ environ = os .environ
131+ environ ['OPENSSL_CONF' ] = self .openssl_env ['OPENSSL_CONF' ]
132+ environ ['RANDFILE' ] = self .openssl_env ['RANDFILE' ]
133+ environ ['CN' ] = self .openssl_env ['CN' ]
130134
131135 if os .path .isfile (self .cert_pem ) and os .path .isfile (self .key_pem ):
132136 self .createSslContexts ()
@@ -152,7 +156,7 @@ def createSslRsaCert(self):
152156 self .log .debug ("Running: %s" % cmd )
153157 proc = subprocess .Popen (
154158 cmd , shell = True , stderr = subprocess .STDOUT ,
155- stdout = subprocess .PIPE , env = self . openssl_env
159+ stdout = subprocess .PIPE , env = environ
156160 )
157161 back = proc .stdout .read ().strip ().decode (errors = "replace" ).replace ("\r " , "" )
158162 proc .wait ()
@@ -175,7 +179,7 @@ def createSslRsaCert(self):
175179 self .log .debug ("Generating certificate key and signing request..." )
176180 proc = subprocess .Popen (
177181 cmd , shell = True , stderr = subprocess .STDOUT ,
178- stdout = subprocess .PIPE , env = self . openssl_env
182+ stdout = subprocess .PIPE , env = environ
179183 )
180184 back = proc .stdout .read ().strip ().decode (errors = "replace" ).replace ("\r " , "" )
181185 proc .wait ()
@@ -194,7 +198,7 @@ def createSslRsaCert(self):
194198 self .log .debug ("Generating RSA cert..." )
195199 proc = subprocess .Popen (
196200 cmd , shell = True , stderr = subprocess .STDOUT ,
197- stdout = subprocess .PIPE , env = self . openssl_env
201+ stdout = subprocess .PIPE , env = environ
198202 )
199203 back = proc .stdout .read ().strip ().decode (errors = "replace" ).replace ("\r " , "" )
200204 proc .wait ()
0 commit comments