-
Notifications
You must be signed in to change notification settings - Fork 5k
Defer RemoteCertificate assignment after X509 Chain build #114781
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
Conversation
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.
Pull Request Overview
This PR defers the assignment of the remote certificate until after building the X509 chain to prevent exceptions when SslStream is disposed in parallel with chain validation.
- Update the null-check to directly evaluate the certificate parameter rather than the previously assigned _remoteCertificate.
- Adjust the order of the _remoteCertificate assignment to occur after chain validation and update the remote callback usage accordingly.
src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Protocol.cs
Show resolved
Hide resolved
Tagging subscribers to this area: @dotnet/ncl, @bartonjs, @vcsjones |
/azp run runtime-libraries-coreclr outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
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
Defer the assignment of the remote certificate until after the X509 chain validation process, this prevents weird exceptions being thrown if SslStream is disposed in parallel with chain building, as in: