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
Move ssl_match_hostname to urllib3.utils. #2198
Conversation
0c3e045
to
5b48e9d
Compare
Codecov Report
@@ Coverage Diff @@
## main #2198 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 24 25 +1
Lines 2240 2284 +44
=========================================
+ Hits 2240 2284 +44
Continue to review full report at Codecov.
|
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.
Thanks for this, instead of pulling the whole module over, can we instead move everything to a single file urllib3.util.ssl_match_hostname
?
71fb278
to
201e714
Compare
@SethMichaelLarson |
No, please don't ignore: we need to include the types from https://github.com/urllib3/urllib3/pull/2198/files#diff-e60901ca7e95a57497217ad9b1a4228bbe3319f6d264575a4f667ac349b015c7 inline in the new file, since we're now Python 3.6+. Do you need help with that? |
We have the same definition in connection.py. Should we keep them as is or import them from |
That sounds better to me! |
4d48cff
to
123c627
Compare
This is looking quite good, but I'd like to fix the Python 3.10 tests (#2201) before doing a thorough review. |
f432f38
to
148edd3
Compare
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.
Couple more comments for you
|
||
|
||
def match_hostname(cert, hostname): | ||
def match_hostname(cert: _PeerCertRetType, hostname: str) -> 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.
Shouldn't cert
be _PeerCertRetDictType
here?
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.
148edd3
to
42adb86
Compare
42adb86
to
a47fe23
Compare
Just rebased with main! |
@hramezani It looks like we're missing coverage by moving the file to utils, perhaps we can create a few test cases to ensure |
3a328d7
to
8b360b2
Compare
@sethmlarson I added some test to cover them |
8b360b2
to
fe971b3
Compare
bcc635f
to
975f7ae
Compare
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.
This looks good to me now, once CI passes I'll merge :)
No description provided.