summaryrefslogtreecommitdiffstats
path: root/Lib/smtplib.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/smtplib.py')
-rwxr-xr-xLib/smtplib.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/smtplib.py b/Lib/smtplib.py
index 6676af8..327a454 100755
--- a/Lib/smtplib.py
+++ b/Lib/smtplib.py
@@ -709,9 +709,8 @@ class SMTP:
if context is None:
context = ssl._create_stdlib_context(certfile=certfile,
keyfile=keyfile)
- 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 = None
# RFC 3207:
# The client MUST discard any knowledge obtained from
@@ -940,9 +939,8 @@ if _have_ssl:
print('connect:', (host, port), file=stderr)
new_socket = socket.create_connection((host, port), timeout,
self.source_address)
- server_hostname = self._host if ssl.HAS_SNI else None
new_socket = self.context.wrap_socket(new_socket,
- server_hostname=server_hostname)
+ server_hostname=self._host)
return new_socket
__all__.append("SMTP_SSL")