make SSLv23 the default version in ftplib (closes #23111)
This commit is contained in:
parent
c1edb585a2
commit
9fe67ceebf
|
@ -384,7 +384,7 @@ FTP_TLS Objects
|
|||
|
||||
.. attribute:: FTP_TLS.ssl_version
|
||||
|
||||
The SSL version to use (defaults to *TLSv1*).
|
||||
The SSL version to use (defaults to :attr:`ssl.PROTOCOL_SSLv23`).
|
||||
|
||||
.. method:: FTP_TLS.auth()
|
||||
|
||||
|
|
|
@ -638,7 +638,7 @@ else:
|
|||
'221 Goodbye.'
|
||||
>>>
|
||||
'''
|
||||
ssl_version = ssl.PROTOCOL_TLSv1
|
||||
ssl_version = ssl.PROTOCOL_SSLv23
|
||||
|
||||
def __init__(self, host='', user='', passwd='', acct='', keyfile=None,
|
||||
certfile=None, timeout=_GLOBAL_DEFAULT_TIMEOUT):
|
||||
|
@ -656,7 +656,7 @@ else:
|
|||
'''Set up secure control connection by using TLS/SSL.'''
|
||||
if isinstance(self.sock, ssl.SSLSocket):
|
||||
raise ValueError("Already using TLS")
|
||||
if self.ssl_version == ssl.PROTOCOL_TLSv1:
|
||||
if self.ssl_version >= ssl.PROTOCOL_SSLv23:
|
||||
resp = self.voidcmd('AUTH TLS')
|
||||
else:
|
||||
resp = self.voidcmd('AUTH SSL')
|
||||
|
|
Loading…
Reference in New Issue