mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +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
|
@ -747,9 +747,8 @@ else:
|
|||
resp = self.voidcmd('AUTH TLS')
|
||||
else:
|
||||
resp = self.voidcmd('AUTH SSL')
|
||||
server_hostname = self.host if ssl.HAS_SNI else None
|
||||
self.sock = self.context.wrap_socket(self.sock,
|
||||
server_hostname=server_hostname)
|
||||
server_hostname=self.host)
|
||||
self.file = self.sock.makefile(mode='r', encoding=self.encoding)
|
||||
return resp
|
||||
|
||||
|
@ -788,9 +787,8 @@ else:
|
|||
def ntransfercmd(self, cmd, rest=None):
|
||||
conn, size = FTP.ntransfercmd(self, cmd, rest)
|
||||
if self._prot_p:
|
||||
server_hostname = self.host if ssl.HAS_SNI else None
|
||||
conn = self.context.wrap_socket(conn,
|
||||
server_hostname=server_hostname)
|
||||
server_hostname=self.host)
|
||||
return conn, size
|
||||
|
||||
def abort(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue