← 返回首页
gh-94172: urllib.request avoids deprecated key_file/cert_file by vstinner · Pull Request #94232 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

gh-94172: urllib.request avoids deprecated key_file/cert_file#94232

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:urllib_key_file
Jun 26, 2022
Merged

gh-94172: urllib.request avoids deprecated key_file/cert_file#94232
vstinner merged 1 commit into
python:mainfrom
vstinner:urllib_key_file

Conversation

vstinner commented Jun 24, 2022
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

The urllib.request module no longer uses the deprecated key_file and
cert_file parameter of the http.client module.

The urllib.request module no longer uses the deprecated key_file and cert_file parameter of the http.client module.
Comment thread Lib/urllib/request.py
# cert and key file means the user wants to authenticate.
# enable TLS 1.3 PHA implicitly even for custom contexts.
if context.post_handshake_auth is not None:
context.post_handshake_auth = True

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

This post_handshake_auth code is already in _create_https_context(), but I copied Python 3.11 code which also checks again post_handshake_auth after calling load_cert_chain().

vstinner merged commit 37118fa into python:main Jun 26, 2022
vstinner deleted the urllib_key_file branch June 26, 2022 08:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Footer

© 2026 GitHub, Inc.