summaryrefslogtreecommitdiffstats
path: root/Lib/httplib.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-11-24 02:13:31 (GMT)
committerBenjamin Peterson <benjamin@python.org>2014-11-24 02:13:31 (GMT)
commit31aa69ead58c53ef670ae45debbcd07e3c099d0b (patch)
treec357bb434acd1d6e39b6a6e70243071244afb3d0 /Lib/httplib.py
parent88922db77568ead498631379ff87c07a22529b7f (diff)
downloadcpython-31aa69ead58c53ef670ae45debbcd07e3c099d0b.zip
cpython-31aa69ead58c53ef670ae45debbcd07e3c099d0b.tar.gz
cpython-31aa69ead58c53ef670ae45debbcd07e3c099d0b.tar.bz2
allow hostname to be passed to SSLContext even if OpenSSL doesn't support SNI (closes #22921)
Patch from Donald Stufft.
Diffstat (limited to 'Lib/httplib.py')
-rw-r--r--Lib/httplib.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py
index db5fa37..6d2e38d 100644
--- a/Lib/httplib.py
+++ b/Lib/httplib.py
@@ -1214,10 +1214,9 @@ else:
server_hostname = self._tunnel_host
else:
server_hostname = self.host
- sni_hostname = server_hostname if ssl.HAS_SNI else None
self.sock = self._context.wrap_socket(self.sock,
- server_hostname=sni_hostname)
+ server_hostname=server_hostname)
if not self._context.check_hostname and self._check_hostname:
try:
ssl.match_hostname(self.sock.getpeercert(), server_hostname)