Skip to content

Commit

Permalink
make SSLv23 the default version in ftplib (closes #23111)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminp committed Jan 4, 2015
1 parent c1edb58 commit 9fe67ce
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Doc/library/ftplib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 2 additions & 2 deletions Lib/ftplib.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ class FTP_TLS(FTP):
'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):
Expand All @@ -656,7 +656,7 @@ def auth(self):
'''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')
Expand Down
2 changes: 2 additions & 0 deletions Misc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Core and Builtins
Library
-------

- Issue #23111: Maximize compatibility in protocol versions of ftplib.FTP_TLS.

- Issue #23112: Fix SimpleHTTPServer to correctly carry the query string and
fragment when it redirects to add a trailing slash.

Expand Down

0 comments on commit 9fe67ce

Please sign in to comment.