File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ def file_or_memory(path=None, data=None):
34
34
# so we use temporary file to load the key
35
35
if data :
36
36
with tempfile .NamedTemporaryFile (mode = "wb" ) as f :
37
- d = base64 .decodebytes ( bytes ( data , encoding = 'utf-8' ) )
37
+ d = base64 .b64decode ( data )
38
38
f .write (d )
39
39
if not d .endswith (b"\n " ):
40
40
f .write (b"\n " )
@@ -102,11 +102,11 @@ def get_server(self, data_center):
102
102
103
103
def create_ssl_context (self ):
104
104
ssl_context = ssl .SSLContext (protocol = ssl .PROTOCOL_SSLv23 )
105
- ssl_context .verify_mode = ssl .VerifyMode . CERT_NONE if self .skip_tls_verify else ssl . VerifyMode .CERT_REQUIRED
105
+ ssl_context .verify_mode = ssl .CERT_NONE if self .skip_tls_verify else ssl .CERT_REQUIRED
106
106
for data_center in self .data_centers .values ():
107
107
with file_or_memory (path = data_center .get ('certificateAuthorityPath' ),
108
108
data = data_center .get ('certificateAuthorityData' )) as cafile :
109
- ssl_context .load_verify_locations (cadata = open (cafile ).read ())
109
+ ssl_context .load_verify_locations (cadata = six . text_type ( open (cafile ).read () ))
110
110
with file_or_memory (path = self .auth_info .get ('clientCertificatePath' ),
111
111
data = self .auth_info .get ('clientCertificateData' )) as certfile , \
112
112
file_or_memory (path = self .auth_info .get ('clientKeyPath' ), data = self .auth_info .get ('clientKeyData' )) as keyfile :
You can’t perform that action at this time.
0 commit comments