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

.NET 8–Keyed/Named Services

A feature that a lot of IoC container libraries support but that was missing in the default DI container provided by Microsoft is the support for Keyed or Named Services. This feature allows you to register the same type multiple times using different names, allowing you to resolve a specific instance based on the circumstances. Although there is some controversy if supporting this feature is a good idea or not, it certainly can be handy. To support this feature a new interface IKeyedServiceProvider got introduced in .NET 8 providing 2 new methods on our ServiceProvider instance: object? GetKeyedService(Type serviceType, object? serviceKey); object GetRequiredKeyedService(Type serviceType, object? serviceKey); To use it, we need to register our service using one of the new extension methods: Resolving the service can be done either through the FromKeyedServices attribute: or by injecting the IKeyedServiceProvider interface and calling the GetRequiredKeyedServic...

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.

Kubernetes–Limit your environmental impact

Reducing the carbon footprint and CO2 emission of our (cloud) workloads, is a responsibility of all of us. If you are running a Kubernetes cluster, have a look at Kube-Green . kube-green is a simple Kubernetes operator that automatically shuts down (some of) your pods when you don't need them. A single pod produces about 11 Kg CO2eq per year( here the calculation). Reason enough to give it a try! Installing kube-green in your cluster The easiest way to install the operator in your cluster is through kubectl. We first need to install a cert-manager: kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.5/cert-manager.yaml Remark: Wait a minute before you continue as it can take some time before the cert-manager is up & running inside your cluster. Now we can install the kube-green operator: kubectl apply -f https://github.com/kube-green/kube-green/releases/latest/download/kube-green.yaml Now in the namespace where we want t...