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

Add support for X509ChainPolicy for QUIC #73056

Merged

Conversation

rzikm
Copy link
Member

@rzikm rzikm commented Jul 29, 2022

Closes #72873.

This PR adds support for Ssl(Server|Client)AuthenticationOptions.CertificateChainPolicy for QUIC. It essentially mirrors what #71961 did for SslStream.

@ghost
Copy link

ghost commented Jul 29, 2022

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

Closes #72873.

This PR adds support for Ssl(Server|Client)AuthenticationOptions.CertificateChainPolicy for QUIC. It essentially mirrors what #55104 did for SslStream.

Author: rzikm
Assignees: -
Labels:

area-System.Net

Milestone: -

@rzikm rzikm changed the title 72873-add-support-for-CertificateChainPolicy-to-Quic Add support for X509ChainPolicy for QUIC Jul 29, 2022
@rzikm
Copy link
Member Author

rzikm commented Jul 29, 2022

Test failures are unrelated

Copy link
Member

@wfurt wfurt left a comment

Choose a reason for hiding this comment

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

I think we should add also http test - to make sure we can catch missing entry in clone fixed by #72326. In that case we can also ensure consistency between http/3 and prior versions e.g. SslStream vs Quic.

It may be nice to take GenerateCertificates from System.Net.Security and move it to Common place.

/// </summary>
private readonly X509ChainPolicy? _chainPolicy;

public SslConnectionOptions(QuicConnection connection, bool isClient, string? targetHost, bool certificateRequired, X509RevocationMode revocationMode, RemoteCertificateValidationCallback? validationCallback, X509ChainPolicy? chainPolicy)
Copy link
Member

Choose a reason for hiding this comment

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

nit: as this gets longer and longer it may be nice to split it to multiple lines.

{
_connection = connection;
_isClient = isClient;
_targetHost = targetHost;
_certificateRequired = certificateRequired;
_revocationMode = revocationMode;
_validationCallback = validationCallback;
_chainPolicy = chainPolicy;
Copy link
Member

Choose a reason for hiding this comment

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

nit: I would probably name it _certificateChainPolicy to match the ssl options.

@wfurt
Copy link
Member

wfurt commented Aug 1, 2022

BTW it seems like the changes to partial chain broke macOS. It still seems right to me - even if client does not send full chain, everything should work if server has the missing parts. There was some flakiness in CI with KeyChain manipulations , or it can be something deterministic on macOS

@rzikm
Copy link
Member Author

rzikm commented Aug 2, 2022

BTW it seems like the changes to partial chain broke macOS

Should I disable the tests for now or revert the change in SslStream tests? I don't have access to my Mac machine to debug it this week and I would prefer not to hold this change.

@wfurt
Copy link
Member

wfurt commented Aug 2, 2022

BTW it seems like the changes to partial chain broke macOS

Should I disable the tests for now or revert the change in SslStream tests? I don't have access to my Mac machine to debug it this week and I would prefer not to hold this change.

I think that would be fine to separate the changes. I can sync & build your branch locally to see if this is something obvious and consistent or if this is some issue with CI machines or race condition.

@rzikm rzikm requested a review from wfurt August 3, 2022 12:28
Copy link
Member

@wfurt wfurt left a comment

Choose a reason for hiding this comment

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

LGTM.
I still think we should add test to HTTP as well but I think it is OK to do it as follow-up change.

@rzikm rzikm merged commit 1f0582e into dotnet:main Aug 4, 2022
@karelz karelz added this to the 7.0.0 milestone Aug 7, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Sep 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add support for CertificateChainPolicy to Quic
3 participants