mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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
|
@ -198,6 +198,9 @@ def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
|
|||
'''
|
||||
global _opener
|
||||
if cafile or capath or cadefault:
|
||||
import warnings
|
||||
warnings.warn("cafile, cpath and cadefault are deprecated, use a "
|
||||
"custom context instead.", DeprecationWarning, 2)
|
||||
if context is not None:
|
||||
raise ValueError(
|
||||
"You can't pass both context and any of cafile, capath, and "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue