-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
Background and Motivation
We use Microsoft.AspNetCore.Authentication.Certificate and for our use case chain validation gets in the way. We have the client certficate explicitly registered server side and validate that aspect in CertificateAuthenticationOptions.Events.OnCertificateValidated. Chain validation is really not needed as the client certificate is validated against a server side copy of the same certificate. If the chain validation fails we never get to doing our validation logic in OnCertificateValidated as the event is never raised.
NOTE: The ideal solution is to use either self signed certificates or certificates with valid chains. That is easier said than done when the same certificates are used across multiple environments.
Proposed API
public enum X509ChainTrustMode
{
NoCheck
}Usage Examples
void ConfigureCertificateAuthentication(CertificateAuthenticationOptions options)
{
options.ChainTrustValidationMode = X509ChainTrustMode.NoCheck;
}Risks
Additive API with opt in use. Should not result in any regression.