Skip to content

Support certificate validation TLS Alerts for OSX #127053

Closed

Description

@rzikm

We already specify that the library should stop when remote cert is received

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.

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);
}

Activity

  1. added this to the Future milestone on Apr 17, 2026
  2. added
    enhancement
    os-macos
    on Apr 17, 2026
  3. dotnet-policy-service commented on Apr 17, 2026

    @dotnet-policy-service
    Contributor

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

  4. self-assigned this
    on May 18, 2026
  5. added a commit that references this issue on Jun 11, 2026
    d6db569
  6. locked and limited conversation to collaborators on Jul 11, 2026
  7. added a commit that references this issue on Jul 15, 2026
    51d68d8
  8. added a commit that references this issue on Jul 22, 2026
    1f751b4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-System.Net.Securityenhancementos-macos

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions