summaryrefslogtreecommitdiff
path: root/Lib/test/test_ftplib.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2016-09-10 23:23:33 +0200
committerChristian Heimes <christian@python.org>2016-09-10 23:23:33 +0200
commitd04863771b0c5bedeb1e4afe05dcba3adcc0fb58 (patch)
treefcd2630f24f426d5c1b084a9e16fe69ae4f5143a /Lib/test/test_ftplib.py
parent130bbe5fd3d0bd0c494078aff19a5f8108707b89 (diff)
downloadcpython-git-d04863771b0c5bedeb1e4afe05dcba3adcc0fb58.tar.gz
Issue #28022: Deprecate ssl-related arguments in favor of SSLContext.
The deprecation include manual creation of SSLSocket and certfile/keyfile (or similar) in ftplib, httplib, imaplib, smtplib, poplib and urllib. ssl.wrap_socket() is not marked as deprecated yet.
Diffstat (limited to 'Lib/test/test_ftplib.py')
-rw-r--r--Lib/test/test_ftplib.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py
index 9d8de211df..12fabc5e8b 100644
--- a/Lib/test/test_ftplib.py
+++ b/Lib/test/test_ftplib.py
@@ -311,10 +311,12 @@ if ssl is not None:
_ssl_closing = False
def secure_connection(self):
- socket = ssl.wrap_socket(self.socket, suppress_ragged_eofs=False,
- certfile=CERTFILE, server_side=True,
- do_handshake_on_connect=False,
- ssl_version=ssl.PROTOCOL_SSLv23)
+ context = ssl.SSLContext()
+ context.load_cert_chain(CERTFILE)
+ socket = context.wrap_socket(self.socket,
+ suppress_ragged_eofs=False,
+ server_side=True,
+ do_handshake_on_connect=False)
self.del_channel()
self.set_socket(socket)
self._ssl_accepting = True