Repository navigation
Closed
Labels
area-System.Net.SecurityenhancementProduct code improvement that does NOT require public API changes/additionsos-macosmacOS aka OSX
Milestone
Description
We already specify that the library should stop when remote cert is received
runtime/src/libraries/System.Net.Security/src/System/Net/Security/SslStreamPal.OSX.cs
Lines 382 to 390 in 6a04342
| case PAL_TlsHandshakeState.ServerAuthCompleted: | |
| case PAL_TlsHandshakeState.ClientAuthCompleted: | |
| // The standard flow would be to call the verification callback now, and | |
| // possibly abort. But the library is set up to call this "success" and | |
| // do verification between "handshake complete" and "first send/receive". | |
| // | |
| // So, call SslHandshake again to indicate to Secure Transport that we've | |
| // accepted this handshake and it should go into the ready state. | |
| break; |
At that point, it might be just a question of calling VerifyRemoteCertificate and plumbing the Alert via SSLSetError in ApplyAlertToken.
runtime/src/libraries/System.Net.Security/src/System/Net/Security/SslStreamPal.OSX.cs
Lines 404 to 414 in 6a04342
| public static SecurityStatusPal ApplyAlertToken( | |
| SafeDeleteContext? securityContext, | |
| TlsAlertType alertType, | |
| TlsAlertMessage alertMessage) | |
| { | |
| // There doesn't seem to be an exposed API for writing an alert, | |
| // the API seems to assume that all alerts are generated internally by | |
| // SSLHandshake. | |
| Debug.Assert(CanGenerateCustomAlerts); | |
| return new SecurityStatusPal(SecurityStatusPalErrorCode.OK); | |
| } |
Metadata
Metadata
Assignees
Labels
area-System.Net.SecurityenhancementProduct code improvement that does NOT require public API changes/additionsos-macosmacOS aka OSX
Activity
dotnet-policy-service commentedon Apr 17, 2026
Tagging subscribers to this area: @dotnet/ncl, @bartonjs, @vcsjones
See info in area-owners.md if you want to be subscribed.
Generate TLS alerts on certificate validation failure on macOS (#128316)
Generate TLS alerts on certificate validation failure on macOS (#128316)
Generate TLS alerts on certificate validation failure on macOS (dotne…