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
bpo-31870: add timeout parameter for get_server_certificate in ssl.py #4126
bpo-31870: add timeout parameter for get_server_certificate in ssl.py #4126
Conversation
""" >>> import ssl >>> ssl.get_server_certificate(("www.qq.com", 443), timeout=6) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/ssl.py", line 1017, in get_server_certificate with closing(create_connection(addr, timeout)) as sock: File "/usr/lib/python2.7/socket.py", line 575, in create_connection raise err socket.error: [Errno 101] Network is unreachable """
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. Thanks again to your contribution and we look forward to looking at it! |
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
b9ad20e
to
97a551d
Compare
@nixawk Do you want to rebase this PR and continue to work with this? |
Since this pull request seems to be abandoned, I'm going to close it. If the original author is interested in continuing to work on it, it can be reopened or someone else can create a new pull request to replace it. If the original author's work is used in a new PR, please give the appropriate credit. |
The original get_server_certificate in ssl.py does not support socket timeout,
After the patch, ssl.py can do it with a timeout parameter, ex: www.qq.com.
https://bugs.python.org/issue31870