Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
do not call RemoteCertificateValidationCallback on the same certificate again #42836
do not call RemoteCertificateValidationCallback on the same certificate again #42836
Changes from 1 commit
4a2492b
3742b5d
833e55b
fea66b1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
What if both are null? Is this possible? Should we call the callback again in that case?
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.
In that case we will fall-through and hit the "normal" case. SslPolicyErrors.RemoteCertificateNotAvailable will be set.
If peer certificate was required (and that is true on client side) that would lead to negotiation failure unless that was override by the callback for some reason. To prevent this form happening twice, we would probably need to add another property to track if this was already called. I simply use presence of certificate to detect that now but it can still probably happen on server side. It feels like unlikely corner case and it should not impact the SocketHttpClient nor be TLS 13 specific. The callback is only one way for app to know "something" e.g. renegotiation happened. So I think it is ok to be called multiple times in general case.
The interesting scenario IMHO would be TLS resume where session can be established without full exchange. I don't know if Schannel remembers the certificates from the previous session and if that generally works same way with OpenSSL. (resume currently not working on Linux but I'm hoping to fix that)