Skip to main content
KBY Technologies Logo

A Client Certificate Exclusion Path on Azure App Service Forces TLS Renegotiation and Fails Uploads Over 100 KB with 403

Medium severityMicrosoft Azure About 20 minutes to fix

Overview

You excluded one path from client certificates and now large uploads return 403 for clients with valid certificates. The cause is TLS renegotiation, not the certificate.

At a glance

Symptom
An internal API sits behind mutual TLS, with Client certificate mode set to Required.
Likely cause
The documentation states that using any client certificate exclusion path triggers TLS renegotiation for incoming requests.
Impact
Because the failure is a 403, it reads as an authorisation problem.
Verification signal
Re-run the az webapp show query and confirm exclusions is empty and the mode is Required or Optional.
Safe correction
Start with the change that weakens nothing.
Rollback or recovery
To go back, restore the exclusion path and mode that you saved from az webapp show, using the same portal screen or the same template properties.

Adding a certificate exclusion path to an Azure App Service app that requires client certificates looks like a small change. It makes App Service renegotiate TLS before it reads each request, and that has two documented side effects. Any POST or PUT larger than 100 KB fails with a 403, and clients on TLS 1.3 or HTTP/2 stop working. The fix is to remove the renegotiation, or to change how clients send large bodies.

Symptom

An internal API sits behind mutual TLS, with Client certificate mode set to Required. A monitor needs to reach one path without a certificate, so someone adds it under Certificate exclusion paths. The monitor turns green and the change is closed.

A few days later a partner reports that uploads fail. Small requests work. A POST or PUT over 100 KB comes back 403, even from clients that present a valid certificate. The error gives no hint that the certificate is not the problem.

The assumption behind it

The exclusion path does what its name says. Paths that start with the value you enter no longer ask for a certificate, and the documentation says matching is not case specific. Everything else still requires one, so the security review passes. The side effect is described in a note on the documentation page, not in the name of the setting.

Root cause

The documentation states that using any client certificate exclusion path triggers TLS renegotiation for incoming requests. App Service has to read the request before it can decide whether to ask for a certificate. The Optional Interactive User mode also triggers renegotiation.

Renegotiation brings two limits. TLS 1.3 and HTTP/2 do not support it, and the page says those protocols do not work if the app uses settings that need renegotiation. POST or PUT requests over 100 KB fail with a 403, because of a buffer size limit that the documentation says is not configurable and cannot be increased.

Impact

Because the failure is a 403, it reads as an authorisation problem. Engineers check the certificate chain, the trusted issuer and the application’s own certificate validation, and none of those is at fault. The failure depends on request size, so it looks intermittent: a health call passes, a 5 KB payload passes, a 2 MB upload fails.

Clients that negotiate TLS 1.3 or HTTP/2 are also affected, which can be mistaken for a client library regression. The excluded path was added to relax access, and the change has narrowed what the app can serve.

How to confirm it

Both checks are read-only. First, record the three settings that decide the behaviour. The documentation names these properties for the app resource, and az webapp show returns the app’s details:

az webapp show --name <app-name> --resource-group <group-name> --query "{enabled:clientCertEnabled, mode:clientCertMode, exclusions:clientCertExclusionPaths}"

If exclusions is not empty, or mode is Optional Interactive User, the app renegotiates. In the portal, the same values are under Settings then Configuration then General settings.

Second, compare a small and a large request from the same client with the same certificate. Send a body just under 100 KB, then one just over it. If the first succeeds and the second returns 403, you have the documented limit rather than a certificate problem.

The shortcuts that make it worse

The tempting fix is to turn client certificates off, because that removes the 403 at once. It also removes mutual authentication from every path. The documentation describes the feature as the way to ensure only clients with valid certificates can connect, so large uploads no longer depend on a certificate at all.

Switching to Optional Interactive User does not help, because it also triggers renegotiation. Lowering protocol settings to dodge TLS 1.3 or HTTP/2 errors treats a symptom and does not remove the limit. The 100 KB limit cannot be raised, so the ways out are the ones the documentation gives: disable renegotiation, or change how requests are sent.

Correction

Start with the change that weakens nothing. Work on a non-production app first, and save the output of az webapp show as your record of the current state.

  1. Change the clients, not the app. Have every client that sends large bodies add the header Expect: 100-Continue. The documentation says the client then waits for a 100 Continue response before sending the body, and the buffers are bypassed. Alternatively, send a HEAD request before the PUT or POST, because the HEAD request handles the client certificate. Nothing on the server changes, so there is nothing to roll back.
  2. Decide whether the exclusion is still needed. Find every caller of the excluded path. If every caller can present a certificate, go to step 3. If one cannot, step 1 covers large uploads, but the exclusion still rules out TLS 1.3 and HTTP/2, so go to step 4.
  3. Remove renegotiation. In the portal, open Settings then Configuration then General settings, use the pencil icon next to Certificate exclusion paths, delete every path, and set Client certificate mode to Required or Optional. Save. The documentation says those two actions disable renegotiation, so the app negotiates the certificate during the handshake. In Bicep or an ARM template, the properties are clientCertMode and clientCertExclusionPaths.
  4. Separate the open endpoint if you must keep one. A path that has to stay open to callers without a certificate is better served from a different app, agreed with whoever owns the monitor, than as an exclusion path on the app that takes large uploads. Moving it is a design change, so plan and test it as one.

Following along? Tap a step’s number to tick it off.

Before step 3, remember that with the mode set to Required, every path then requires a certificate. A monitor that used the old exclusion starts failing, so warn its owner first.

Verification

Re-run the az webapp show query and confirm exclusions is empty and the mode is Required or Optional. Then send the over-100 KB request again with a valid certificate. It should succeed, with or without the Expect header. A request with no certificate should be refused, which shows that mutual authentication is still on. Repeat the check from a client that negotiates TLS 1.3 or HTTP/2.

Rollback

To go back, restore the exclusion path and mode that you saved from az webapp show, using the same portal screen or the same template properties. That brings back the renegotiation limits, so keep the Expect: 100-Continue change on the clients. The header does no harm either way, so leave it in place.

Stop it happening again

  • Treat clientCertExclusionPaths and the Optional Interactive User mode as a protocol change. Review them for TLS 1.3, HTTP/2 and upload size, not only for access.
  • Keep the three client certificate properties in your infrastructure code, so a portal edit shows up as drift.
  • Put the 100 KB limit in the API documentation your partners read, and tell them to send Expect: 100-Continue.
  • Test uploads above 100 KB whenever client certificate settings change.
3

Apply the safer control

Before you change production

Confirm the affected scope, export the current configuration, and test the replacement control in a non-production environment first.

Fix commands and configuration

az webapp show
az webapp show --name <app-name> --resource-group <group-name> --query "{enabled:clientCertEnabled, mode:clientCertMode, exclusions:clientCertExclusionPaths}"
exclusions
4

When to escalate

Validation and rollback are covered in the sections above.

Escalate

Escalate when the blast radius is uncertain, the control cannot be tested safely, or remediation requires an outage or security exception.

The KBY Brief

Fixed? Get the next one before it hits you: The KBY Brief

Practical fixes for the systems you run, by email about twice a week. Unsubscribe at any time.

About this page

Credited to

Dates

Published

Corrections

No corrections are listed for this page. Some review sweeps corrected pages without naming each one; those are in the corrections log.

Was this useful?

Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.

Found this useful? Follow KBY for more like it.

After remediation

Further reading stays below the corrective workflow and is selected by platform, category and shared technical keywords.

More from KBY that goes with this config trap.

Discover more

Connected KBY resources