diff options
author | Christian Heimes <christian@python.org> | 2016-09-10 21:23:33 (GMT) |
---|---|---|
committer | Christian Heimes <christian@python.org> | 2016-09-10 21:23:33 (GMT) |
commit | d04863771b0c5bedeb1e4afe05dcba3adcc0fb58 (patch) | |
tree | fcd2630f24f426d5c1b084a9e16fe69ae4f5143a /Lib/http | |
parent | 130bbe5fd3d0bd0c494078aff19a5f8108707b89 (diff) | |
download | cpython-d04863771b0c5bedeb1e4afe05dcba3adcc0fb58.zip cpython-d04863771b0c5bedeb1e4afe05dcba3adcc0fb58.tar.gz cpython-d04863771b0c5bedeb1e4afe05dcba3adcc0fb58.tar.bz2 |
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/http')
-rw-r--r-- | Lib/http/client.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/http/client.py b/Lib/http/client.py index 6ee1913..a8e59b9 100644 --- a/Lib/http/client.py +++ b/Lib/http/client.py @@ -1365,6 +1365,12 @@ else: check_hostname=None): super(HTTPSConnection, self).__init__(host, port, timeout, source_address) + if (key_file is not None or cert_file is not None or + check_hostname is not None): + import warnings + warnings.warn("key_file, cert_file and check_hostname are " + "deprecated, use a custom context instead.", + DeprecationWarning, 2) self.key_file = key_file self.cert_file = cert_file if context is None: |