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
Keep hostname's trailing dot #2888
base: main
Are you sure you want to change the base?
Conversation
@zhanpon Are you interested in completing this pull request? |
@sethmlarson Thank you for looking at this pull request.
Sure, I will try to add some tests this weekend. Any advice would be appreciated! |
def teardown_class(cls) -> None: | ||
super().teardown_class() | ||
|
||
def test_basic_proxy(self) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I run this test against v2.0.2, it fails with an exception: urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='localhost.', port=64015): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'localhost.'. (_ssl.c:992)")))
r = http.request("GET", f"{self.https_url_with_dot}/") | ||
assert r.status == 200 | ||
|
||
def test_https_proxy(self) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I run this test against v2.0.2, it fails with an exception: urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='localhost.', port=64034): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'localhost.'. (_ssl.c:992)")))
Summary
This resolves both #2244 and #2873. It follows the behavior of curl >= 7.83.1 (See A tale of a trailing dot for details).
TODO