Mutual TLS authenticates peers within an identity scope
Bind verified client certificates to workload principals and enforce action- and resource-specific authorization across service and proxy boundaries.
On this page
The question for today
What you’ll understand
- Distinguish requiring a client certificate in a fresh certificate-authenticated handshake from merely requesting one.
- Map a verified certificate to a principal in a defined trust domain.
- Enforce resource-scoped permission after mutual authentication.
Mutual TLS lets both ends authenticate certificate-backed peers during a connection. It is useful for identifying workloads, but a certificate does not automatically define a global service name or grant every action. The verifier must decide which issuers it trusts, which identifier it extracts, and what that identifier means in its own domain. Application policy then determines what the authenticated workload may do. Follow that chain explicitly so a successful mutual handshake does not become unrestricted internal access.
Client certificate handling has acceptance semantics
In a fresh, non-resumed certificate-authenticated handshake, a server can request a client certificate, verify a presented certificate, and require a valid certificate as a condition of continuing. Those are distinct configuration choices. In a library such as OpenSSL, verification modes affect whether an absent required client certificate aborts that handshake. Disable session resumption when testing both an untrusted certificate and no certificate in this fresh-handshake fixture. TLS 1.3 PSK resumption can omit Certificate and CertificateVerify while retaining policy-bound authenticated context; separately test the resumed identity and current authorization policy. Seeing CertificateRequest alone does not prove enforced rejection.
Once verification succeeds, map the certificate to a workload principal using documented identifiers and issuer context. A DNS or URI identifier is meaningful only under a policy that defines its issuance and expected scope. Workload identity systems can use trust domains to distinguish identically named services managed by different authorities. Avoid equating a free-form subject string with an authorization role. The identifier's provenance and the key-possession proof matter together; a copied certificate without its corresponding private key does not complete the same authentication.
A workload identity is not an end-user identity
A frontend service may authenticate to a backend with its own workload certificate while handling requests from many users. The backend still needs trustworthy user and tenant context if access depends on them. Permission for the frontend to call the backend does not mean every user behind it may access every object. Decide which service is responsible for each authorization decision and how delegated context is validated. Otherwise a broadly trusted workload can become a confused deputy for an unprivileged requester.
A TLS-terminating proxy changes the peer visible to the next hop. Passing an arbitrary client-identity header through unchanged can let a caller claim another principal unless the trusted boundary strips, replaces, and protects that assertion. If the proxy uses its own certificate to the backend, the backend authenticates the proxy on that leg. Original-client identity requires an additional trustworthy propagation design; it is not automatically preserved as cryptographic peer identity through every intermediary. Test a direct bypass path as well as the intended proxy path.
Authorization evidence includes deliberate denials
Create a small policy table that states allowed calls, forbidden actions, and cross-tenant denials. Exercise each with valid workload authentication so an earlier certificate failure does not hide a missing authorization rule. Then independently test certificate absence, unknown issuers, expired credentials, and unexpected workload identifiers with resumption disabled for those fresh certificate-authentication fixtures. Logging should distinguish TLS identity failure from application permission denial without exposing private keys or reusable credentials. This makes a denial explainable and prevents a generic connection error from being counted as proof of the wrong control.
Use the probability lab only to examine random-test coverage of a synthetic policy population. Reset, set both p=0.1 for an independently selected case exposing a missing denial and n=20, predict zero detections, then Play or Step. The exact binomial distribution neither authenticates a certificate nor evaluates a policy. Shared policy templates and repeated similar cases can correlate failures, so a clean random run cannot replace the explicit allowed and denied principal/action/resource cases just described.
Work it through
Count explicit permission decisions
A small review considers three workload principals, four actions, and one tenant-scoped resource. Only two principal/action pairs are granted for that resource. Assume every principal has a valid certificate in the accepted trust domain.
Count the candidate decisions: 3 principals × 4 actions × 1 resource = 12 triples. All twelve can reach the authorization boundary under the stated valid-authentication assumption.
The grant set contains two triples, leaving ten specified denials. Requiring mutual TLS does not convert those ten denials into grants merely because the callers possess valid certificates.
Test the two successful actions and the ten denials with the correct resource scope. Adding another tenant's resource doubles the candidate table to twenty-four triples and requires its own scoped policy rather than copying identity acceptance into blanket access.
Mutual authentication supplies the principal evidence for twelve decisions, while the explicit policy permits only two. Resource scope remains part of every decision.
The living notebook
Explore the model
Interactive lab · probability
Random policy cases can miss a missing denial
Reset, set both synthetic defect-detection probability p=0.1 and independent case count n=20, predict zero detections, then Play or Step. No certificate mapping, trust-domain validation, or access policy is executed.
- Mean · np
- 5
- Variance · np(1−p)
- 2.5
- Total probability
- 1
These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forMutual TLS identifies a peer under policy; deliberate resource-scoped denial tests establish a different control.
Pause & reason
Check your understanding
Your turn
Try it yourself
A TLS-terminating proxy connects to a backend using its own workload certificate and forwards a caller-supplied X-User header unchanged. Why does backend mTLS not authenticate the original user named in that header?
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Identify the cryptographic peer on the backend connection and who controlled the header's original bytes.
Compare with the solution
The backend handshake authenticates the proxy's certificate-backed identity on that connection. It does not prove that the caller-supplied X-User value names an authenticated original user. A trusted propagation design must validate the original user, remove untrusted assertions, and protect the resulting context across the proxy boundary. The backend must also restrict bypass paths and apply user/resource authorization; mTLS to the proxy alone proves none of those additional steps.
Keep the idea
Take it with you
- Fresh certificate-authenticated mTLS must reject absent or invalid required client credentials; resumption needs separate identity-policy tests.
- Verified workload identity has issuer and trust-domain scope.
- User delegation, proxy propagation, and resource permission remain explicit application controls.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.