Skip to main content

The quest of the 403.16 error in IIS

Ever heard about the 403.16 HTTP error response code? I certainly did not. But it was exactly this error code we got back after configuring IIS to expect a client certificate. In this post I’ll explain how we tackled the issue and found a solution(workaround?).

How to configure IIS to expect a client certificate?

First step is to enable SSL on IIS:

  • Open IIS Manager.

  • Select your site and click Bindings.

  • Add or edit an HTTPS binding and select a valid SSL certificate.

Now we need to configure our website so that it requires a client certificate:

  • In IIS Manager, select your site.

  • Click SSL Settings.

  • Check Require SSL.

  • Under Client certificates, select Require.

  • Click on Apply.

A last optional step is to configure client certificate mapping:

  • Navigate to Authentication settings.

  • Enable IIS Client Certificate Mapping Authentication.

    • Remark: If you don’t find this option, you first need to install it through the Windows installer(Turn Windows features on or off)  or Enable it first at the IIS level.

  • Configure One-To-One or Many-To-One mappings.

What does the 403.16 error code means?

Let’s first focus on the 403 error code. This is an HTTP status code that means "Forbidden". It indicates that the server understood the request but refuses to authorize it.

Common causes of a 403 error are:

  • Insufficient Permissions – The user does not have the necessary rights to access the resource.

  • Authentication Issues – The request lacks proper authentication credentials.

  • IP Restrictions – The server blocks access based on IP address.

  • Misconfigured Server Settings – The website's permissions may be incorrectly set.

  • Blocked Content – Some sites restrict access to certain regions or users.

Unlike a 401 Unauthorized error, where authentication might resolve the issue, a 403 Forbidden error means that even with proper credentials, access is still denied.

The 403.16 error code is an IIS specific status code that indicates an issue with client certificate authentication on a website hosted on Internet Information Services. Specifically, it means that the client certificate is either untrusted or invalid.

How to fix the 403.16 error code?

The most common causes of this error are:

  • Cause 1: Root certificate isn't in Trusted Root Certification Authorities Certificate store

  • Cause 2: Non-self-signed certificates are in Trusted Root Certification Authorities Certificate store

This is will explained on Microsoft Learn here: HTTP Error 403.16 when you access a website - Internet Information Services | Microsoft Learn

However in our case, the root cause was related but we had to use a different solution.

We first verified that the root cause was indeed the certificate. We did this by activating Failed Request Tracing as explained in this post: IIS–Failed Request Tracing.

The failed request log file confirmed that it was indeed the certificate that was causing a problem. However the issue in this case is that the certificate provided was signed by an external Certification Authority that we did not trust. As this certificate was only provided to be used for testing purposes, we changed the trust mode for Trusted Issuers.

From the documentation:

There are three Client Authentication Trust Modes supported by the Schannel provider. The trust mode controls how validation of the client’s certificate chain is performed and is a system-wide setting controlled by the REG_DWORD “ClientAuthTrustMode” under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\Schannel.

Value Trust mode Description
0 Machine Trust (default) Requires that the client certificate is issued by a certificate in the Trusted Issuers list.
1 Exclusive Root Trust Requires that a client certificate chains to a root certificate contained in the caller-specified trusted issuer store. The certificate must also be issued by an issuer in the Trusted Issuers list
2 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.<

For information about authentication failures due to trusted issuers configuration issues, see Knowledge Base article 280256.

We were able to fix the problem by changing the Trust Mode to '2'.

More information

403.16 error : "Root certificate which is not trusted by the trust provider. (0x800b0109)" | Microsoft Community Hub

HTTP Error 403.16 when you access a website - Internet Information Services | Microsoft Learn

IIS–Failed Request Tracing

What's New in TLS-SSL (Schannel SSP) | Microsoft Learn

IIS may reject requests with HTTP 403.7 or 403.16 errors - Internet Information Services | Microsoft Learn

Popular posts from this blog

Podman– Command execution failed with exit code 125

After updating WSL on one of the developer machines, Podman failed to work. When we took a look through Podman Desktop, we noticed that Podman had stopped running and returned the following error message: Error: Command execution failed with exit code 125 Here are the steps we tried to fix the issue: We started by running podman info to get some extra details on what could be wrong: >podman info OS: windows/amd64 provider: wsl version: 5.3.1 Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM Error: unable to connect to Podman socket: failed to connect: dial tcp 127.0.0.1:2655: connectex: No connection could be made because the target machine actively refused it. That makes sense as the podman VM was not running. Let’s check the VM: >podman machine list NAME         ...

Cache stampede: when our cache turned against us

While investigating some performance issues, we ran into an ASP.NET Core API that cached a fairly expensive aggregation query for 60 seconds. Under normal load, that was fine: one request rebuilds the cache, everyone else reads from it. Under peak load, dozens of requests would arrive in that same expiry window, all see a cache miss, and all fire the same expensive query in parallel. The database didn't like that. That was the moment when our caching layer stopped helping and started hurting. A burst of requests comes in at the same time, all miss the cache, and all go hammer the database or the downstream API at once. That's a cache stampede . The cache was supposed to protect our backend, and for a few hundred milliseconds it did the opposite. Why this happens IMemoryCache.GetOrCreate (and its async sibling) looks like it protects you, but it doesn't add any locking on its own. Look at the naive version: public async Task<Report> GetReportAsync(string key) ...

Azure DevOps/ GitHub emoji

I’m really bad at remembering emoji’s. So here is cheat sheet with all emoji’s that can be used in tools that support the github emoji markdown markup: All credits go to rcaviers who created this list.