summaryrefslogtreecommitdiffstats
path: root/Lib/http/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/http/client.py')
-rw-r--r--Lib/http/client.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/http/client.py b/Lib/http/client.py
index 1039fa5..6c38c4a 100644
--- a/Lib/http/client.py
+++ b/Lib/http/client.py
@@ -1081,7 +1081,9 @@ else:
self.sock = sock
self._tunnel()
- self.sock = self._context.wrap_socket(sock)
+ server_hostname = self.host if ssl.HAS_SNI else None
+ self.sock = self._context.wrap_socket(sock,
+ server_hostname=server_hostname)
try:
if self._check_hostname:
ssl.match_hostname(self.sock.getpeercert(), self.host)