Skip to content

Replace deprecated ssl.match_hostname method (fixes: #368)#389

Merged
jlaine merged 1 commit intoaiortc:mainfrom
jlaine:use-service-identity
Jul 5, 2023
Merged

Replace deprecated ssl.match_hostname method (fixes: #368)#389
jlaine merged 1 commit intoaiortc:mainfrom
jlaine:use-service-identity

Conversation

@jlaine
Copy link
Copy Markdown
Contributor

@jlaine jlaine commented Jul 5, 2023

The standard libraries's ssl.match_hostname method was marked as deprecated in Python 3.10. Rather than implementing this critical piece of code ourselves, make use of the Python Cryptographic Authority's service-identity package.

One notable behaviour change is that validation is performed only against the subjectAltName extension instead of the commonName. This is the same behaviour as web browsers use.

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 5, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (33b7609) 100.00% compared to head (2c40dd5) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #389   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines         4551      4542    -9     
=========================================
- Hits          4551      4542    -9     
Impacted Files Coverage Δ
src/aioquic/tls.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

The standard libraries's `ssl.match_hostname` method was marked as
deprecated in Python 3.10. Rather than implementing this critical piece
of code ourselves, make use of the Python Cryptographic Authority's
`service-identity` package.

One notable behaviour change is that validation is performed *only*
against the `subjectAltName` extension instead of the `commonName`. This
is the same behaviour as web browsers use.
@jlaine jlaine force-pushed the use-service-identity branch from e8b1300 to 2c40dd5 Compare July 5, 2023 08:57
@jlaine jlaine merged commit b097478 into aiortc:main Jul 5, 2023
@jlaine jlaine deleted the use-service-identity branch July 5, 2023 14:55
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.

1 participant