mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
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.
This commit is contained in:
parent
130bbe5fd3
commit
d04863771b
23 changed files with 189 additions and 85 deletions
|
@ -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':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue