Skip to content

Improve assert_hostname and server_hostname documentation - #2169

Merged
sethmlarson merged 2 commits into
urllib3:mainfrom
pquentin:assert-hostname-doc
Mar 8, 2021
Merged

sethmlarson merged 2 commits into
urllib3:mainfrom
pquentin:assert-hostname-doc

Conversation

@pquentin

@pquentin pquentin commented Mar 8, 2021 •

Copy link
Copy Markdown
Member

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)

pquentin added 2 commits March 8, 2021 14:51
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

codecov Bot commented Mar 8, 2021 •

Copy link
Copy Markdown

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

@sethmlarson sethmlarson left a comment

Copy link
Copy Markdown
Member

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!

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