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

Keep hostname's trailing dot #2888

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Keep hostname's trailing dot #2888

wants to merge 7 commits into from

Conversation

zhanpon
Copy link
Contributor

@zhanpon zhanpon commented Jan 13, 2023

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

  • Add more tests

@sethmlarson
Copy link
Member

@zhanpon Are you interested in completing this pull request?

@zhanpon
Copy link
Contributor Author

zhanpon commented May 19, 2023

@sethmlarson Thank you for looking at this pull request.

Are you interested in completing 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:
Copy link
Contributor Author

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:
Copy link
Contributor Author

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)")))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants