aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/imaplib.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-11-23 17:04:34 -0600
committerBenjamin Peterson <benjamin@python.org>2014-11-23 17:04:34 -0600
commit7243b574e5fc6f9ae68dc5ebd8252047b8e78e3b (patch)
tree4cd25f9fde37754132337eebdd1b1e958bf979f4 /Lib/imaplib.py
parent378e15d7abedb4a1990230d5e3c74d2390be96c4 (diff)
downloadcpython-7243b574e5fc6f9ae68dc5ebd8252047b8e78e3b.tar.gz
cpython-7243b574e5fc6f9ae68dc5ebd8252047b8e78e3b.zip
don't require OpenSSL SNI to pass hostname to ssl functions (#22921)
Patch by Donald Stufft.
Diffstat (limited to 'Lib/imaplib.py')
-rw-r--r--Lib/imaplib.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/imaplib.py b/Lib/imaplib.py
index ad104fe76a7..72ab5d79e5f 100644
--- a/Lib/imaplib.py
+++ b/Lib/imaplib.py
@@ -745,9 +745,8 @@ class IMAP4:
ssl_context = ssl._create_stdlib_context()
typ, dat = self._simple_command(name)
if typ == 'OK':
- server_hostname = self.host if ssl.HAS_SNI else None
self.sock = ssl_context.wrap_socket(self.sock,
- server_hostname=server_hostname)
+ server_hostname=self.host)
self.file = self.sock.makefile('rb')
self._tls_established = True
self._get_capabilities()
@@ -1223,9 +1222,8 @@ if HAVE_SSL:
def _create_socket(self):
sock = IMAP4._create_socket(self)
- server_hostname = self.host if ssl.HAS_SNI else None
return self.ssl_context.wrap_socket(sock,
- server_hostname=server_hostname)
+ server_hostname=self.host)
def open(self, host='', port=IMAP4_SSL_PORT):
"""Setup connection to remote server on "host:port".