Mutual TLS

Also known as: mTLS

On this page 7

Mutual TLS (mTLS) is a mode of Transport Layer Security in which both the client and the server authenticate each other with X.509 certificates during the TLS handshake, instead of only the server proving its identity. In Internet trust, it extends the familiar public key model from “the browser trusts the website” to two-way, certificate-based identity, which makes it a standard building block for service-to-service traffic, APIs, device fleets and zero trust networks.

Ordinary HTTPS answers one question: is this really the server I meant to reach? Mutual TLS adds a second one: is this really a client that is allowed to connect at all? Because the answer is settled cryptographically before any application data flows, mTLS shifts part of authentication from passwords and tokens into the transport layer itself.

How mutual TLS extends the TLS handshake

Mutual TLS works by adding a client certificate request to the normal handshake. After the server sends its own certificate, it sends a CertificateRequest message listing the signature algorithms and, optionally, the certificate authorities it accepts. The client then returns its certificate chain and a CertificateVerify message signed with its private key, proving possession of the key rather than mere possession of a public certificate.

The server validates the client chain exactly as a client validates a server chain: it builds a path to a trusted root or intermediate CA, checks validity dates, key usage and the clientAuth extended key usage, and may consult revocation data through OCSP or a certificate revocation list. In TLS 1.3 the client certificate travels inside the encrypted part of the handshake, so it is not exposed to passive observers, an improvement over TLS 1.2, where it was sent in clear text.

The following table summarizes the additional handshake messages and what each contributes to authentication.

MessageSent byPurpose
CertificateRequestServerAsks the client for a certificate and names acceptable CAs
CertificateClientDelivers the client certificate chain
CertificateVerifyClientProves control of the matching private key
FinishedBothConfirms the handshake transcript was not altered
Handshake messages added by mutual TLS

Mutual TLS compared with other authentication methods

Mutual TLS differs from token and password schemes because the credential is bound to a key that never leaves the client. A stolen bearer token can be replayed from anywhere, whereas a client certificate is useless without its private key, which may sit in a hardware security module, TPM or secure enclave. The trade-off is operational: certificates must be issued, distributed, rotated and revoked.

The comparison below places mTLS beside the methods it most often replaces or complements.

MethodProof of identityMain strengthMain weakness
Mutual TLSClient certificate and private keyPhishing-resistant, transport-levelCertificate lifecycle overhead
API keyShared secret stringVery simple to deployEasily leaked and replayed
OAuth bearer tokenSigned or opaque tokenFine-grained, short-lived scopesReplayable if intercepted
Server-only TLSServer certificate onlyUniversal browser supportClient stays anonymous at transport
Mutual TLS and common alternatives

These methods are frequently combined. RFC 8705 defines certificate-bound access tokens, in which an OAuth token is valid only when presented over an mTLS connection using the same client certificate, so a leaked token cannot be replayed by another party.

Where mutual TLS is deployed

Mutual TLS is used wherever machines rather than people must prove identity at scale. It rarely appears on the public web for human visitors because browser client certificate prompts are confusing and hard to manage, but it is pervasive behind the scenes.

ContextWho holds client certificatesTypical issuer
Service meshEvery workload or podMesh control plane CA
Partner and banking APIsBusiness clientsPrivate or regulated CA
IoT device fleetsEach deviceManufacturer or cloud IoT CA
Zero trust accessManaged laptops and phonesEnterprise PKI
Database and broker linksApplication serversInternal PKI
Typical deployment contexts

In a service mesh, sidecar proxies terminate mTLS automatically and receive identities such as SPIFFE IDs encoded in the certificate subject alternative name. Certificates there often live for hours rather than months, which reduces dependence on revocation because a compromised credential expires quickly.

Designing a mutual TLS trust model

The security of mutual TLS depends far more on which CAs the server trusts than on the protocol itself. Accepting client certificates from a public web PKI root would let anyone with any public certificate connect, so mTLS deployments almost always rely on a dedicated private CA whose only job is issuing client identities.

  • Restrict the trust store to the issuing CA for clients, separate from the server certificate chain.
  • Map certificate fields to identities explicitly, for example a SAN URI or DNS name, rather than trusting the common name loosely.
  • Keep lifetimes short and automate renewal with protocols such as ACME or SCEP-style enrollment.
  • Plan revocation through OCSP, CRLs or simply very short validity periods.
  • Authorize after authenticating: a valid certificate proves who the client is, not what it may do.

Where TLS terminates also matters. When a load balancer ends the mTLS session, it must forward the verified identity to the backend in a trusted header, and the backend must reject that header from any other source; otherwise a client could forge it.

Common mutual TLS failures and their causes

Most mutual TLS incidents are operational failures, not cryptographic breaks. Expired certificates, incomplete chains and misplaced trust anchors cause outages, while overly broad trust and header spoofing cause security gaps.

SymptomLikely causeFix
Sudden mass connection failuresClient or CA certificate expiredAutomate rotation and monitor expiry
Handshake alert: unknown CAMissing intermediate in client chainSend the full chain from the client
Any certificate is acceptedServer trusts a broad public root storeTrust only the private client CA
Identity spoofed at backendUnprotected forwarded identity headerStrip and re-set headers at the proxy
Revoked device still connectsRevocation checking disabledEnable OCSP or shorten lifetimes
Symptoms, causes and fixes

A further limitation is that mTLS authenticates the endpoint holding the key, not the human using it. If malware runs on an enrolled machine, it inherits that machine’s identity, which is why mTLS is usually paired with device posture checks and application-level authorization.

The simple explanation

Normally, when you visit a secure website, only the website shows an ID card. Your browser checks it and decides the site is genuine, but the site does not learn who you are until you log in.

Mutual TLS means both sides show an ID card. The server checks the visitor’s card too, and if the card was not issued by an authority it trusts, the conversation ends before it begins. Think of a building where guards and visitors both carry badges and each checks the other at the door. The key point is that identity is proven in both directions, automatically, before any data is exchanged.

How it is used in practice

A payments company runs about 200 internal microservices on Kubernetes. Previously, services trusted any request coming from inside the cluster network, so one compromised container could call the ledger service directly. The platform team introduces a service mesh that gives every workload a certificate from an internal CA, valid for 24 hours and renewed automatically every 12 hours.

The ledger service now accepts connections only over mTLS and authorizes callers by the service identity in the certificate: the checkout service may post transactions, while the reporting service may only read. When a penetration tester later gains a shell in a marketing container, attempts to reach the ledger fail at the handshake. The result is that network location no longer grants access; only a valid, short-lived workload identity does, and the audit logs record exactly which service made each call.