summaryrefslogtreecommitdiffstats
path: root/Lib/poplib.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-11-23 23:04:34 (GMT)
committerBenjamin Peterson <benjamin@python.org>2014-11-23 23:04:34 (GMT)
commit7243b574e5fc6f9ae68dc5ebd8252047b8e78e3b (patch)
tree4cd25f9fde37754132337eebdd1b1e958bf979f4 /Lib/poplib.py
parent378e15d7abedb4a1990230d5e3c74d2390be96c4 (diff)
downloadcpython-7243b574e5fc6f9ae68dc5ebd8252047b8e78e3b.zip
cpython-7243b574e5fc6f9ae68dc5ebd8252047b8e78e3b.tar.gz
cpython-7243b574e5fc6f9ae68dc5ebd8252047b8e78e3b.tar.bz2
don't require OpenSSL SNI to pass hostname to ssl functions (#22921)
Patch by Donald Stufft.
Diffstat (limited to 'Lib/poplib.py')
-rw-r--r--Lib/poplib.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/poplib.py b/Lib/poplib.py
index 2b0e3d5..8ad9cb7 100644
--- a/Lib/poplib.py
+++ b/Lib/poplib.py
@@ -387,9 +387,8 @@ class POP3:
if context is None:
context = ssl._create_stdlib_context()
resp = self._shortcmd('STLS')
- server_hostname = self.host if ssl.HAS_SNI else None
self.sock = context.wrap_socket(self.sock,
- server_hostname=server_hostname)
+ server_hostname=self.host)
self.file = self.sock.makefile('rb')
self._tls_established = True
return resp
@@ -430,9 +429,8 @@ if HAVE_SSL:
def _create_socket(self, timeout):
sock = POP3._create_socket(self, timeout)
- server_hostname = self.host if ssl.HAS_SNI else None
sock = self.context.wrap_socket(sock,
- server_hostname=server_hostname)
+ server_hostname=self.host)
return sock
def stls(self, keyfile=None, certfile=None, context=None):