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:
@@ -1267,7 +1267,10 @@ if HAVE_SSL:
|
||||
if ssl_context is not None and certfile is not None:
|
||||
raise ValueError("ssl_context and certfile arguments are mutually "
|
||||
"exclusive")
|
||||
|
||||
if keyfile is not None or certfile is not None:
|
||||
import warnings
|
||||
warnings.warn("keyfile and certfile are deprecated, use a"
|
||||
"custom ssl_context instead", DeprecationWarning, 2)
|
||||
self.keyfile = keyfile
|
||||
self.certfile = certfile
|
||||
if ssl_context is None:
|
||||
|
||||
Reference in New Issue
Block a user