diff options
author | Christian Heimes <christian@python.org> | 2016-09-10 23:23:33 +0200 |
---|---|---|
committer | Christian Heimes <christian@python.org> | 2016-09-10 23:23:33 +0200 |
commit | d04863771b0c5bedeb1e4afe05dcba3adcc0fb58 (patch) | |
tree | fcd2630f24f426d5c1b084a9e16fe69ae4f5143a /Lib/test/test_nntplib.py | |
parent | 130bbe5fd3d0bd0c494078aff19a5f8108707b89 (diff) | |
download | cpython-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_nntplib.py')
-rw-r--r-- | Lib/test/test_nntplib.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_nntplib.py b/Lib/test/test_nntplib.py index 2ef6d02c2b..feaba3c3c0 100644 --- a/Lib/test/test_nntplib.py +++ b/Lib/test/test_nntplib.py @@ -1542,8 +1542,10 @@ class LocalServerTests(unittest.TestCase): elif cmd == b'STARTTLS\r\n': reader.close() client.sendall(b'382 Begin TLS negotiation now\r\n') - client = ssl.wrap_socket( - client, server_side=True, certfile=certfile) + context = ssl.SSLContext() + context.load_cert_chain(certfile) + client = context.wrap_socket( + client, server_side=True) cleanup.enter_context(client) reader = cleanup.enter_context(client.makefile('rb')) elif cmd == b'QUIT\r\n': |