protocol: fix requests to servers needing SNI ext

This commit is contained in:
dece 2021-02-16 19:10:32 +01:00
parent b23e4a8d6a
commit 4cb8ac11d6

View file

@ -85,7 +85,7 @@ class Request:
context = Request.get_ssl_context() context = Request.get_ssl_context()
try: try:
self.ssock = context.wrap_socket(sock) self.ssock = context.wrap_socket(sock, server_hostname=hostname)
except OSError as exc: except OSError as exc:
self.state = Request.STATE_CONNECTION_FAILED self.state = Request.STATE_CONNECTION_FAILED
self.error = exc.strerror self.error = exc.strerror