summaryrefslogtreecommitdiff
path: root/Lib/ftplib.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2016-09-10 23:23:33 +0200
committerChristian Heimes <christian@python.org>2016-09-10 23:23:33 +0200
commitd04863771b0c5bedeb1e4afe05dcba3adcc0fb58 (patch)
treefcd2630f24f426d5c1b084a9e16fe69ae4f5143a /Lib/ftplib.py
parent130bbe5fd3d0bd0c494078aff19a5f8108707b89 (diff)
downloadcpython-git-d04863771b0c5bedeb1e4afe05dcba3adcc0fb58.tar.gz
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/ftplib.py')
-rw-r--r--Lib/ftplib.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/ftplib.py b/Lib/ftplib.py
index ee2a137a5c..8f36f537e8 100644
--- a/Lib/ftplib.py
+++ b/Lib/ftplib.py
@@ -728,6 +728,10 @@ else:
if context is not None and certfile is not None:
raise ValueError("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 context instead", DeprecationWarning, 2)
self.keyfile = keyfile
self.certfile = certfile
if context is None: