This commit is contained in:
Benjamin Peterson 2014-11-23 17:06:39 -06:00
commit f9284ae8ed
16 changed files with 24 additions and 79 deletions

View file

@ -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")