mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
merge 3.4 (#22921)
This commit is contained in:
commit
f9284ae8ed
16 changed files with 24 additions and 79 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue