Custom certificate validation callback returns true but revocation checks still run
0 reputation · 23 May 2022, 09:39 UTC
Goal: Confirm whether returning true from HttpClientHandler.ServerCertificateCustomValidationCallback reliably suppresses platform certificate chain building and revocation checking in .NET 6 through .NET 9.
Uncertainty: Windows (Schannel), Linux (OpenSSL), and macOS (SecureTransport) invoke the callback at different points in validation. CheckCertificateRevocationList defaults differ between .NET Framework and .NET Core/.NET 5+, and X509Chain.ChainElements may be incomplete off Windows. No single public API uniformly disables all platform validation while preserving custom logic.
Because behavior varies by TLS backend and .NET version, a cross-platform comparison is needed before relying on the callback as a bypass mechanism.
Does returning true from the callback prevent revocation checks on each platform? Is CheckCertificateRevocationList=false required in addition to the callback? Can chain inspection inside the callback be trusted equally on Windows, Linux, and macOS?