don't require OpenSSL SNI to pass hostname to ssl functions (#22921)

Patch by Donald Stufft.
This commit is contained in:
Benjamin Peterson 2014-11-23 17:04:34 -06:00
parent 378e15d7ab
commit 7243b574e5
16 changed files with 22 additions and 67 deletions

View file

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