Skip to content

Commit

Permalink
Fixed issue for AttributeError: 'TLSConnection' object has no attribu…
Browse files Browse the repository at this point in the history
…te 'key_file'
  • Loading branch information
baluluyakalulu committed Jun 10, 2024
1 parent 6ffa146 commit e670f68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ucsmsdk/ucsdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def connect(self):
ssl_context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
ssl_context.options |= ssl.OP_NO_SSLv2
ssl_context.options |= ssl.OP_NO_SSLv3
if self.key_file and self.cert_file:
if getattr(self, "key_file", None) and getattr(self, "cert_file", None):
ssl_context.load_cert_chain(keyfile=self.key_file,
certfile=self.cert_file)
self.sock = ssl_context.wrap_socket(sock)
Expand Down

0 comments on commit e670f68

Please sign in to comment.