summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-12-30 21:15:43 (GMT)
committerBenjamin Peterson <benjamin@python.org>2014-12-30 21:15:43 (GMT)
commit36fe7926f888ba154b64904b91a5dd8c83e6c167 (patch)
tree52d4535826386783b6a5f1e3598f4586d1a8c0c2
parent3cd1af51f67d56874529a4581e9cdbd3c7277cee (diff)
downloadcpython-36fe7926f888ba154b64904b91a5dd8c83e6c167.zip
cpython-36fe7926f888ba154b64904b91a5dd8c83e6c167.tar.gz
cpython-36fe7926f888ba154b64904b91a5dd8c83e6c167.tar.bz2
make PROTOCOL_SSLv23 the default protocol version for ftplib (closes #23111)
-rw-r--r--Lib/ftplib.py4
-rw-r--r--Misc/NEWS3
2 files changed, 5 insertions, 2 deletions
diff --git a/Lib/ftplib.py b/Lib/ftplib.py
index 9c73f5f..cd8c1a9 100644
--- a/Lib/ftplib.py
+++ b/Lib/ftplib.py
@@ -713,7 +713,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, context=None,
@@ -743,7 +743,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')
diff --git a/Misc/NEWS b/Misc/NEWS
index 7932c77..42cbc39 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -41,6 +41,9 @@ Core and Builtins
Library
-------
+- Issue #23111: In the ftplib, make ssl.PROTOCOL_SSLv23 the default protocol
+ version.
+
- Issue #22585: On OpenBSD 5.6 and newer, os.urandom() now calls getentropy(),
instead of reading /dev/urandom, to get pseudo-random bytes.