cswork / libraryOpen practice workspace

Articles

mTLS Interview Questions: Peer Identity, Certificate Rotation, and Trust Domains

Practice mTLS interview questions with a peer-identity trace, SPIFFE trust-domain checks, a safe certificate-rotation sequence, and failure diagnosis.

An mTLS interview question is rarely answered by saying “both sides have certificates.” The interviewer wants to know which peer is authenticated, which identity the application accepts, and what happens when certificates or trust roots change while traffic is flowing. A successful handshake can still connect the wrong authorized service, and a rotated certificate can still leave old connections alive. Trace those boundaries before proposing a proxy or a PKI.

Imagine an orders service calling ledger to post a settlement. The client presents a workload certificate; the server presents its own. The ledger should accept only an approved orders workload from the production trust domain, then authorize the specific settlement operation. Midway through a root rotation, some connections fail even though both certificates appear unexpired. This one scenario exposes the handshake, identity, authorization, rotation, and debugging questions that matter in a systems interview. For general identity terminology, see Authentication and Authorization Interview Questions: OAuth, OIDC, JWT, and Sessions.

Evidence boundary: Official facts about TLS 1.3, SPIFFE identities and trust bundles, and Envoy certificate loading come from their primary specifications and documentation checked in September 2026. Candidate reports are not used to predict a company's exact question. Inference includes the orders/ledger architecture, sample policy, and rollout checks; the implementation details depend on the chosen TLS stack and deployment.

What does mutual TLS prove in a service call?

Ordinary TLS normally authenticates the server to the client. In mutual TLS, the server also requests and verifies a client certificate. RFC 8446 describes TLS 1.3's CertificateRequest when certificate-based client authentication is desired and the certificate and signature messages used for authentication. The exact message sequence and configuration vary by TLS version and stack, but the core question is symmetric: did each peer prove possession of the key for a certificate accepted by the other?

That proof needs more than a chain that ends at some trusted root. The client must verify that the server certificate identifies the intended ledger endpoint. The ledger must verify that the client certificate identifies the allowed orders workload. Validity period, chain, key usage where applicable, and the expected name or identity all matter. Trusting a CA without checking the expected peer identity can accept a different service issued by the same authority.

In a mesh, the actual TLS endpoints may be sidecar proxies, not the application processes. Then the interview answer must say which proxy verifies the peer identity, how that identity reaches the application, and whether untrusted clients can spoof an identity header on a bypass path. Encryption between proxies does not automatically secure a cleartext hop to the workload or make every route enforce the same policy.

How do you separate authentication from authorization?

Authentication answers “which workload presented a valid identity?” Authorization answers “may that workload invoke this operation on this resource now?” A client certificate for spiffe://prod.example/orders could be cryptographically valid yet not permitted to call ledger's administrative endpoint. Conversely, a role written in an HTTP header is not enough unless the server knows the trusted component that asserted it.

The SPIFFE concepts guide describes a SPIFFE ID as a URI with a trust domain and workload identifier. Its X.509-SVID binds that identity to a certificate. In this example, ledger might require an ID exactly matching spiffe://prod.example/orders for settlement POSTs, while a reconciliation endpoint may allow a different identity. The URI path is an identity label, not a list of permissions. The application or an authorization proxy still needs the action/resource policy.

LayerQuestion in the orders → ledger callPossible failure
Transport handshakeDid both sides prove keys and accept certificate chains?Unknown issuer or expired certificate
Peer identityIs the URI SAN the expected workload and trust domain?Valid certificate for a different service
AuthorizationMay this workload post this settlement?Valid identity, forbidden operation
Application stateIs the settlement valid and idempotent?Duplicate or inconsistent business operation

This trace is the first useful interview asset. It prevents the common mistake of treating a green TLS handshake as proof of business permission. It also gives a debugging order: locate the layer that rejected the call before changing certificate trust or broadening an authorization rule.

What is a trust domain, and why does its name matter?

SPIFFE's trust domain identifies an administrative and cryptographic boundary: a workload's ID contains its trust-domain name, and a verifier uses the corresponding trust bundle to check its SVID. The SPIFFE trust-domain and bundle specification distinguishes identity namespaces and issuing authorities. The name alone is not proof; the verifier must bind that name to the right bundle and validate the certificate against it.

Suppose staging and production share a network but have different trust domains. A staging workload should not become production orders merely because both environments use a path called /orders. The full identity, including trust domain, is the authorization input. If the team intentionally allows cross-domain traffic, SPIFFE federation provides a way to distribute and authenticate foreign bundles. Federation expands who can be authenticated; it does not imply that every identity from the foreign domain is authorized for every API.

An interviewer may ask whether “trust all certificates from both roots” solves an outage. It might restore handshakes, but it can also widen the accepted identity set. State the expected peer ID and allowed operations first, then adjust bundle distribution only after confirming which root is missing. Broad trust is a poor substitute for diagnosing a trust-domain mismatch.

How does an X.509-SVID reach a workload?

The SPIFFE Workload API specification describes retrieving X.509-SVIDs and related trust bundles. A workload or proxy can obtain short-lived identity material from a local provider and refresh it as it changes. SPIFFE's concepts documentation emphasizes that bundles and workload credentials rotate. The design question is not simply whether issuance works once; it is whether every live TLS endpoint consumes new material before the old material expires.

This is implementation-specific. Envoy's certificate-management documentation says static referenced certificates do not reload automatically without a restart or listener/cluster reload, while certificates referenced through Secret Discovery Service can be updated via watched files or an external SDS server. If an interview candidate says “the file changed, so all proxies use the new certificate,” ask which loading mode and reload signal make that true.

The private key must stay protected, and the workload must not accept an arbitrary certificate merely because a local process placed it on disk. Bootstrap identity, agent authorization, file permissions, and the trust of the local Workload API are part of the deployment model. A chain of trust begins before the first network handshake.

How do you rotate a certificate without breaking traffic?

Separate leaf rotation from root rotation. For a leaf certificate issued under the same trusted root, distribute the new credential to the presenting endpoint, confirm it is loaded, establish fresh handshakes, and retire the old leaf after the expected overlap. If the TLS endpoint does not reload, replacing a file can leave it presenting the old leaf until restart or reload. Monitor expiry and actual presented serial or identity, not just the issuance dashboard.

Root rotation has a more delicate order. A practical sequence is: distribute a bundle that accepts both old and new roots to verifiers; confirm every relevant verifier has activated it; issue and load new leaves under the new root; test fresh connections in both directions; then remove the old root only after no needed peer still depends on it. The overlap is intentional. It is not a permanent policy to trust stale roots forever.

PhasePresenterVerifierFresh handshake expectation
BeforeOld leafOld rootSucceeds
Bundle overlapOld leafOld + new rootsSucceeds
New issuanceNew leafOld + new rootsSucceeds
RetirementNew leafNew rootSucceeds; old-only presenter fails

The table is a rollout reasoning tool, not a claim that every product rotates the same way. In a two-way handshake, repeat it for both parties: orders must trust ledger's new chain, and ledger must trust orders' new chain. A partial rollout can fail only in one direction or one replica, so sample fresh connections across regions and instances.

An already-established TLS connection usually does not rerun the certificate handshake merely because a file or trust bundle changed. That is why a root removal or emergency credential response should consider connection lifetime, session resumption behavior, draining, and whether the service must terminate old sessions. Merely observing successful existing traffic can hide a broken new-handshake path. Conversely, a newly fixed trust bundle may not revoke access already granted on a long-lived connection; application authorization may need reevaluation per request.

What do you do when a rotation fails?

Start with the failing pair and time. Is this a fresh connection or an existing one? Which endpoint presents which chain and identity? Which trust-bundle version does the verifier have? Does the failure occur in certificate validation, expected-name matching, or later application authorization? Record those answers before pushing another emergency root.

Three failures have different fixes. An unknown authority error points to an untrusted chain or missing bundle. A successful handshake followed by 403 points to authorization or identity mapping, not necessarily PKI. Intermittent failures on only new connections may indicate inconsistent bundle activation or certificate reload across replicas. Expiry errors can reflect a stale presenter, a clock problem, or failed renewal; inspect the actual certificate offered on the failing connection.

For a compromised key, short-lived credentials reduce the exposure window but do not themselves terminate established sessions or guarantee instant revocation. Decide whether to withdraw a workload identity, replace a root, change authorization policy, close live connections, or all of the above according to the incident. Test that the blocked identity cannot form new connections and cannot continue an operation on a retained connection if the security requirement demands immediate cutoff.

What mistakes should you avoid in the interview?

“Both certificates are valid, so access is allowed” skips peer-name verification and authorization. “mTLS encrypts every hop” ignores termination at sidecars or load balancers. “Rotation is atomic” ignores propagation and reload. “New certificate issued” does not mean “new certificate presented.” “Trust-domain federation grants access” confuses authentication scope with API permission. “Revoked certificate stops all traffic immediately” ignores long-lived sessions and the actual revocation mechanism.

The stronger answer names each trust boundary, states the expected identity, draws the rotation order, and proposes evidence from fresh and retained connections. That is the difference between knowing the acronym and being able to operate the system safely.

Sources and Further Reading