2

Our aim is to host an ASP.NET Core 9.0 web site on IIS and to use client certificate for authentication. The ASP.NET Core web app is working well: when running directly from Kestrel, everything works as expected, ie, the user is prompted to choose a valid certificate that will be used to authenticate her.

The doc says that IIS configuration is limited to 3 steps:

  1. Select site from the connections tabs
  2. Double click SSL settings option
  3. click the require ssl checkbox and select the require radio button in the client certificates section

Unfortunately, it doesn't work. We've activated Failed Requests Tracing and with that config, the ASP.NET Core Module will always terminate the request with the request is not supported error:

enter image description here

Notice that the end user will always end up seeing a 500 error page and doesn't event get a chance to choose the certificate that will be used for authentication.

So, in order to make thinks simple, we've decided to remove the aspnet core app from the equation and have a simple site, with a single index.html page, and see if at least we can configure it so that the browser lets the user choose a certificate.

We've activated only the https binding on the site:

enter image description here

And have also changed the default SSL settings:

enter image description here

We've also activated Failed request tracing in order to get more info about what's going on. This initial config ended up with the traditional 500 error:

enter image description here

And here is the output of the failed request tracing file:

enter image description here

After some more digging, we've also found this post. Once more, we've updated our web.config so that it looked like this (we had to unlock the authentication subsections at the root level):

<security> <authentication> <anonymousAuthentication enabled="false" /> <iisClientCertificateMappingAuthentication enabled="true" /> </authentication> </security> 

The results are still the same. So, we've went ahead and add a mapping from a certificate to an existing user (we've used IIS manager in order to get things right):

<security> <authentication> <anonymousAuthentication enabled="false" /> <windowsAuthentication enabled="false" /> <iisClientCertificateMappingAuthentication enabled="true"> <oneToOneMappings> <add userName="XXX" password="[enc:IISCngProvider:wX....]" certificate="MIIFTDCCBDSgAwIBAgITdQAAEJsn8Q3PLgZ4iwAAAAAQm..." /> </oneToOneMappings> </iisClientCertificateMappingAuthentication> </authentication> </security> 

Once more, still doesn't work (ie, the user never gets a change to choose a certificate). After some more digging, we've found some posts that say that windows auth must be enabled in order for it to work. So we've activated it:

<windowsAuthentication enabled="true" /> 

But no, still not working. Loading the page never gives me the chance to choose a certificate.

So, can anyone point me to valid doc which shows how to configure IIS to require that client presents a certificate when navigating to a web site?

1 Answer 1

1

Luckily for me, I've found this post.

Bottom line: there's a bug with TLS 1.3 when using client certificates for auth, so you'll have to disable its support at site level.

3
  • You might accept the answer to close the discussion. Commented Feb 23 at 22:40
  • Downvoting. I did tests using IIS on Windows Server 2025 and basic .NET app, disabled all auth modes except Client Cert Authentication. Then disabled all TLS versions up to TLS 1.3 to ensure that it is used. Then used MS Edge browser to connect to app. I was prompted for certificate and after cert selection, the app correctly opened in browser. The bug isn't confirmed. Commented Feb 27 at 11:39
  • You can downvote at will. I'm running windows 2022 server. Thanks for asking. Commented Feb 27 at 14:12

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.