-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[QUIC] Certificate name validation #56175
Conversation
Tagging subscribers to this area: @dotnet/ncl Issue DetailsExtracts Fixes #55193 For now just manually verified in asp.net core test. I will add specific tests tomorrow. cc: @wfurt
|
src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicConnection.cs
Outdated
Show resolved
Hide resolved
with this, validation should be easier in ldap @AnthonyMastrean (#55017) |
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.
generally looks god to me. We should add some testes.
- set TargetHost to something else than "loopback" with existing cert and the name error should show up.
- In ideal case we should check that connection to 127.0.0.1 and ::1 works without getting the name error since they both should be in altName (at least the one we generate)
I think current tests ignore all the passed info and simple call new chain rebuild without name check.
@@ -150,5 +150,8 @@ | |||
<data name="net_quic_writing_notallowed" xml:space="preserve"> | |||
<value>Writing is not allowed on stream.</value> | |||
</data> | |||
<data name="net_ssl_app_protocols_invalid" xml:space="preserve"> |
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.
do we need this? looks like extra.
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.
Yes we need this, it's used by one of the included interop source files:
runtime/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.SslCtx.cs
Line 43 in d148c34
throw new ArgumentException(SR.net_ssl_app_protocols_invalid, nameof(applicationProtocols)); |
@@ -83,6 +121,14 @@ | |||
<Reference Include="System.Threading.Channels" /> | |||
</ItemGroup> | |||
|
|||
<ItemGroup> | |||
<ProjectReference Include="$(LibrariesProjectRoot)System.Security.Cryptography.OpenSsl\src\System.Security.Cryptography.OpenSsl.csproj" /> |
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.
Do we still need this with all the added interop?
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.
Yes, we do, the interop uses public classes from this project. It doesn't build without it and the same it's referenced in S.N.Http.
@wfurt tests added as you suggested. If you're happy with it, feel free to merge on my behalf. |
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.
LGTM
Extracts
CertificateValidation
for Windows into shared sources and make use of it and the Unix version in S.N.Quic to properly verify the cert the same waySslStream
does.Fixes #55193
For now just manually verified in asp.net core test. I will add specific tests tomorrow.
cc: @wfurt