mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
don't require OpenSSL SNI to pass hostname to ssl functions (#22921)
Patch by Donald Stufft.
This commit is contained in:
parent
378e15d7ab
commit
7243b574e5
16 changed files with 22 additions and 67 deletions
|
@ -289,8 +289,7 @@ if _have_ssl:
|
|||
# Generate a default SSL context if none was passed.
|
||||
if context is None:
|
||||
context = ssl._create_stdlib_context()
|
||||
server_hostname = hostname if ssl.HAS_SNI else None
|
||||
return context.wrap_socket(sock, server_hostname=server_hostname)
|
||||
return context.wrap_socket(sock, server_hostname=hostname)
|
||||
|
||||
|
||||
# The classes themselves
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue