mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +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
|
@ -469,10 +469,11 @@ Connection: close
|
|||
@unittest.skipUnless(ssl, "ssl module required")
|
||||
def test_cafile_and_context(self):
|
||||
context = ssl.create_default_context()
|
||||
with self.assertRaises(ValueError):
|
||||
urllib.request.urlopen(
|
||||
"https://localhost", cafile="/nonexistent/path", context=context
|
||||
)
|
||||
with support.check_warnings(('', DeprecationWarning)):
|
||||
with self.assertRaises(ValueError):
|
||||
urllib.request.urlopen(
|
||||
"https://localhost", cafile="/nonexistent/path", context=context
|
||||
)
|
||||
|
||||
class urlopen_DataTests(unittest.TestCase):
|
||||
"""Test urlopen() opening a data URL."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue