Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated keyfile, certfile and check_hostname parameters, in favor of context #94172

Open
vstinner opened this issue Jun 23, 2022 · 1 comment
Labels
type-bug

Comments

@vstinner
Copy link
Member

@vstinner vstinner commented Jun 23, 2022

In Python 3.6, the keyfile, certfile and check_hostname parameters were deprecated in ftplib, http.client, imaplib, poplib, and smtplib modules. IMO it's now time to remove them in favor of the context parameters. Most Python projects now require Python 3.6 and newer (if not Python 3.7 or Python 3.8). And it's easy to support older Python versions with some if/else code.

I'm working on a PR to remove these parameters.

@vstinner vstinner added the type-bug label Jun 23, 2022
vstinner added a commit to vstinner/cpython that referenced this issue Jun 23, 2022
Remove the keyfile, certfile and check_hostname parameters,
deprecated since Python 3.6, in modules: ftplib, http.client,
imaplib, poplib and smtplib. Use the context parameter (ssl_context
in imaplib) instead.
vstinner added a commit to vstinner/cpython that referenced this issue Jun 23, 2022
Remove the keyfile, certfile and check_hostname parameters,
deprecated since Python 3.6, in modules: ftplib, http.client,
imaplib, poplib and smtplib. Use the context parameter (ssl_context
in imaplib) instead.

ftplib: Remove the FTP_TLS.ssl_version class attribute: use the
context parameter instead.
@vstinner
Copy link
Member Author

@vstinner vstinner commented Jun 23, 2022

See the old issue #72209 which introduced the deprecation for the rationale of removing these parameters.

vstinner added a commit to vstinner/cpython that referenced this issue Jun 24, 2022
The urllib.request no longer uses the deprecated check_hostname
parameter of the http.client module.

Add http.client._create_https_context() helper to http.client, reused
by urllib.request.
vstinner added a commit to vstinner/cpython that referenced this issue Jun 24, 2022
The urllib.request no longer uses the deprecated check_hostname
parameter of the http.client module.

Add http.client._create_https_context() helper to http.client, reused
by urllib.request.

Remove the now redundant check on check_hostname and verify_mode in
http.client: the SSLContext.check_hostname setter already implements
the check.
vstinner added a commit to vstinner/cpython that referenced this issue Jun 24, 2022
The urllib.request no longer uses the deprecated check_hostname
parameter of the http.client module.

Add http.client._create_https_context() helper to http.client, reused
by urllib.request.

Remove the now redundant check on check_hostname and verify_mode in
http.client: the SSLContext.check_hostname setter already implements
the check.
vstinner added a commit to vstinner/cpython that referenced this issue Jun 24, 2022
The urllib.request no longer uses the deprecated check_hostname
parameter of the http.client module.

Add http.client._create_https_context() helper to http.client, reused
by urllib.request.

Remove the now redundant check on check_hostname and verify_mode in
http.client: the SSLContext.check_hostname setter already implements
the check.
vstinner added a commit that referenced this issue Jun 24, 2022
The urllib.request no longer uses the deprecated check_hostname
parameter of the http.client module.

Add private http.client._create_https_context() helper to http.client,
used by urllib.request.

Remove the now redundant check on check_hostname and verify_mode in
http.client: the SSLContext.check_hostname setter already implements
the check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug
Projects
None yet
Development

No branches or pull requests

1 participant