Security
Mutual TLS: Keep Client Identity Intact Across the Proxy
Verify mutual TLS at the actual termination point, separate authentication from application authorization and protect forwarded client identity at the origin.
In this article
Mutual TLS adds client-certificate authentication to the TLS connection, but the application still needs to decide what that identity may do. When a reverse proxy terminates TLS, the origin does not automatically receive the same authenticated connection. The identity handoff becomes a separate trust boundary.
TLS 1.3’s specification defines the certificate-authentication exchange. Your proxy and application documentation define how that result reaches application code. Do not assume a header containing a certificate name is trustworthy merely because the public endpoint uses HTTPS.
Mark the actual termination point
List the client, edge or proxy, and origin connection. Identify where the client certificate is requested and verified. Then identify whether the next hop uses TLS, mTLS or another protected transport.
The client-to-edge certificate exchange and the edge-to-origin exchange are separate connections. A proxy’s own client certificate on the second hop identifies the proxy to the origin; it does not inherently identify the original end user.
Record who controls trust anchors, certificate issuance and identity mapping at each boundary. A shared diagram prevents one team from assuming another layer performs a check that no component actually owns.
Separate authentication from permission
A valid client certificate can establish an identity under the configured trust policy. It does not automatically authorize every API operation. The application must map the authenticated identity to the intended tenant, role or workload permission.
For an invented example, a certificate for a reporting service might permit reading one tenant’s summaries but not changing billing settings. If the application accepts every certificate from the same authority as an administrator, the cryptography can work while authorization remains wrong.
Use a stable documented identity field and mapping rule. Do not select an arbitrary display name just because it looks human-readable. Certificate contents and organizational naming practices need deliberate interpretation.
Protect the forwarded identity channel
If the proxy forwards an identity indication, follow its supported mechanism. Strip or overwrite untrusted inbound copies, and ensure the origin accepts that indication only from the approved proxy path.
An attacker-supplied header must not become an authenticated identity merely because it uses the same name as the proxy’s header. The origin also needs a policy for requests where the indication is absent, malformed or inconsistent.
Do not solve this by exposing the origin directly and trusting a secret-looking header name. Header obscurity is not an authenticated channel. Use supported network and transport controls appropriate to the deployment.
Build an explicit acceptance matrix
In authorized staging, test a valid approved client, no certificate, an untrusted issuer, an expired test certificate and a valid identity lacking permission for the requested operation.
Expect different outcomes for authentication and authorization failures. A rejected TLS connection may never reach application logging, while an authenticated but unauthorized request may produce an application-level denial.
Add a request through the intended proxy with a spoofed inbound identity indication. Verify that the trusted mechanism replaces or rejects it and that the origin sees only the approved identity. Use synthetic identities and do not attempt this against unrelated services.
Check connection reuse and policy changes
TLS authentication occurs on a connection. Long-lived connections, pooled upstream connections and policy changes can complicate assumptions about when a new certificate or trust configuration takes effect.
Test the documented behavior when a client renews its certificate and when the proxy reloads trust settings. Do not assume editing a file immediately changes every established session.
Define how urgent access removal is enforced under your system’s supported lifecycle. A short certificate lifetime can be one component, but it does not replace understanding revocation, connection duration and application authorization updates.
Avoid leaking certificate information
Log only the identifiers needed for diagnosis and audit. Public certificates are not private keys, but their subjects, internal names and organizational details may still be sensitive operational information.
Never copy private keys into proxy headers, application logs or support reports. Keep key custody and renewal in the approved secret-management workflow. A troubleshooting convenience should not create a second uncontrolled credential store.
When a request fails, correlate a safe request identifier across proxy and application logs. Check whether it failed before TLS completion, during identity forwarding or at the application permission check.
Verify the origin cannot bypass the boundary
Inspect the deployed access paths and confirm that the origin’s intended entry points enforce the same trust assumptions. A forgotten public endpoint can make the carefully configured edge irrelevant for that route.
After a change, retest both successful authorized work and explicit denials. A green health check using the proxy’s own identity is not proof that original client identities are mapped correctly.
Keep a negative authorization test in the release suite so later role-map changes cannot silently broaden access.
Conclusion
mTLS authenticates a connection, while the application authorizes an identity. Preserve that distinction across proxies, protect the handoff and verify the denial cases as carefully as the successful handshake.