In the def _get_connected_socket( method inside the if is_ssl the ssl_context.wrap_socket() call will raise an exception without any message making it difficult for downstream users to identify why they are getting an exception.
Recommend catching exception and raising with a more meaningful message to make it easier for downstream users.
Something along the lines of:
if is_ssl:
try:
socket = ssl_context.wrap_socket(socket, server_hostname=host)
except Exception as error:
# if error is null / blank raise exception with a more meaningful message)
if not str(error):
raise RuntimeError("ssl_context could not wrap_socket")
raise error
connect_host = host
else:
connect_host = addr_info[-1][0]