Trivial updates

This commit is contained in:
Miroslav Stampar
2024-06-26 13:21:01 +02:00
parent a79ed52463
commit 9a87f47777
5 changed files with 9 additions and 17 deletions

View File

@@ -80,7 +80,7 @@ class HTTPSConnection(_http_client.HTTPSConnection):
# Reference(s): https://askubuntu.com/a/1263098
# https://askubuntu.com/a/1250807
_contexts[protocol].set_ciphers("DEFAULT@SECLEVEL=1")
except ssl.SSLError:
except (ssl.SSLError, AttributeError):
pass
result = _contexts[protocol].wrap_socket(sock, do_handshake_on_connect=True, server_hostname=self.host if re.search(r"\A[\d.]+\Z", self.host or "") is None else None)
if result: