Skip to content

Commit

Permalink
Check for cert_file attribute before accessing it (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenzymadness committed May 24, 2023
1 parent b522664 commit 275a4b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion distlib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,7 @@ def connect(self):
context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
if hasattr(ssl, 'OP_NO_SSLv2'):
context.options |= ssl.OP_NO_SSLv2
if self.cert_file:
if hasattr(self, 'cert_file') and self.cert_file:
context.load_cert_chain(self.cert_file, self.key_file)
kwargs = {}
if self.ca_certs:
Expand Down

0 comments on commit 275a4b6

Please sign in to comment.