Skip to content

Commit f5d9f48

Browse files
committed
Handle undefined cert and key files.
1 parent a862743 commit f5d9f48

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/createsend/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def connect(self):
106106
context = ssl.SSLContext()
107107
context.verify_mode = ssl.CERT_REQUIRED
108108
context.load_verify_locations(cert_path)
109-
if self.cert_file and self.key_file:
109+
if hasattr(self, 'cert_file') and hasattr(self, 'key_file') and self.cert_file and self.key_file:
110110
context.load_cert_chain(certfile=self.cert_file, keyfile=self.key_file)
111111
self.sock = context.wrap_socket(sock)
112112
else:

0 commit comments

Comments
 (0)