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

Improve assert_hostname and server_hostname documentation #2169

Merged
merged 2 commits into from Mar 8, 2021

Conversation

pquentin
Copy link
Member

@pquentin pquentin commented Mar 8, 2021

The default value of assert_hostname is server_hostname, so specifying assert_hostname for SNI isn't needed. Also, even if the IP of badssl.com probably isn't that stable, being able to actually run the example seems nicer than using a private IP.

Having a separate example for assert_hostname clarifies that it's not only about SNI. Again, I've used badssl.com since that allows to actually run the example.

Fixes #2126 (the type documentation will be handled by #2162)

The default value of `assert_hostname` is `server_hostname`, so
specifying `assert_hostname` isn't needed. Also, even if the IP of
badssl.com probably isn't that stable, being able to actually run the
example seems nicer than using a private IP.
@codecov
Copy link

codecov bot commented Mar 8, 2021

Codecov Report

Merging #2169 (d1f8cee) into main (dc6284c) will decrease coverage by 0.49%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2169      +/-   ##
==========================================
- Coverage   99.95%   99.45%   -0.50%     
==========================================
  Files          25       25              
  Lines        2221     2208      -13     
==========================================
- Hits         2220     2196      -24     
- Misses          1       12      +11     
Impacted Files Coverage Δ
src/urllib3/util/wait.py 90.69% <0.00%> (-9.31%) ⬇️
src/urllib3/util/ssl_.py 97.00% <0.00%> (-3.00%) ⬇️
src/urllib3/_collections.py 99.32% <0.00%> (-0.68%) ⬇️
src/urllib3/connection.py 99.40% <0.00%> (-0.60%) ⬇️
src/urllib3/response.py 99.47% <0.00%> (-0.53%) ⬇️
src/urllib3/util/timeout.py 100.00% <0.00%> (ø)
src/urllib3/util/ssltransport.py 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dc6284c...b83e9d1. Read the comment docs.

@pquentin pquentin closed this Mar 8, 2021
@pquentin pquentin reopened this Mar 8, 2021
Copy link
Member

@sethmlarson sethmlarson left a comment

Choose a reason for hiding this comment

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

Great example with badssl.com, thanks for this!

@sethmlarson sethmlarson merged commit f5a688f into urllib3:main Mar 8, 2021
@pquentin pquentin deleted the assert-hostname-doc branch September 24, 2021 09:18
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.

HTTPSConnection fails when assert_hostname is True
2 participants