Repository navigation
Don't throw in NegotiateClientCertificateAsync if Post-Handshake auth wasn't enabled. - #128942
Merged
Merged
Conversation
Contributor
|
Tagging subscribers to this area: @dotnet/ncl, @bartonjs, @vcsjones |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the Unix/OpenSSL renegotiation / TLS 1.3 post-handshake-auth (PHA) path so SslStream.NegotiateClientCertificateAsync can gracefully no-op (instead of throwing) when the peer didn’t enable/offer PHA, and adds a Linux/TLS 1.3 functional regression test for that scenario.
Changes:
- Populate the OpenSSL error code on TLS 1.3 PHA initiation failures (native) and propagate renegotiation status back to
SslStream(managed). - Map OpenSSL renegotiation failures to a status that
SslStreamcan interpret as “no renegotiation / keep session usable”. - Add a Linux TLS 1.3 functional test for
NegotiateClientCertificateAsyncwhen PHA isn’t offered.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/native/libs/System.Security.Cryptography.Native/pal_ssl.c | Improves TLS 1.3 PHA initiation error reporting from OpenSSL in the renegotiation entrypoint. |
| src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs | Changes how OpenSSL renegotiation failures are surfaced to managed code. |
| src/libraries/System.Net.Security/src/System/Net/Security/SslStreamPal.Unix.cs | Ensures renegotiation failures return a ProtocolToken carrying the status (instead of default). |
| src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamNetworkStreamTest.cs | Adds coverage for NegotiateClientCertificateAsync when TLS 1.3 PHA isn’t offered (Linux/OpenSSL). |
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
This was referenced Jun 3, 2026
Open
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
wfurt
reviewed
Jun 4, 2026
wfurt
approved these changes
Jun 9, 2026
This was referenced Jun 11, 2026
eiriktsarpalis
pushed a commit
that referenced
this pull request
Jul 15, 2026
… wasn't enabled. (#128942) Small change to avoid a cryptic exception in a corner case where client does not offer any client certificates. --------- Co-authored-by: Copilot Autofix powered by AI <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Small change to avoid a cryptic exception in a corner case where client does not offer any client certificates.