403 - Forbidden: Access is denied. ASP.NET Core MVC IIS Cliente certificate SSL

Viewed 5223

I am tryng to deploy my application in net core 2.1 with a client certificate in IIS.

To do that in IIS: autentication configuration is disable SSL is required

And I am autenticating with my pfx in mi local, and in the server is installed the certificate with .cer in trusted root.

But all the time i am getting the 403 error:forbidden. ¿How can i fix my problem? If someone has the code or information or a video it will be so helpfully for me

1 Answers

first, check the iis log for the sub status code first which is located at %SystemDrive%\inetpub\logs\LogFiles.

if the error is 403.16 Forbidden: Client Certificate Untrusted or Invalid:

It seems that IIS 8.X is not using the Certificate Trust List by default, without this list client authentication via certificates will fail with the 403.16 error and the certificate is considered untrusted.

to resolve this issue you could try to set the below DWORD registry key:

SendTrustedIssuerList = 0 (stop sending a list of trusted root certification authorities during the TLS/SSL handshake process)

ClientAuthTrustMode = 2 (Set trust mode to Exclusive CA Trust, requires that a client certificate chain to either an intermediate CA certificate or root certificate in the caller-specified trusted issuer store.)

after doing changes restart the machine.

another thing is if you are using iis require SSL setting then set the client certificate to accept:

enter image description here

Related