SSOGEN / Learn / What is mTLS?

Learn

What is mTLS?

Mutual TLS (mTLS) is TLS in which the client also proves its identity with an X.509 certificate during the handshake. The server must then check which client connected, not only which CA issued the certificate.

A teal connector seated in a switch port, labelled CN=lb01.acme.example Accepted; loose connectors labelled Refused
Right CA, wrong client: a CA alone is never enough.

In ordinary TLS, only the server presents a certificate. In mutual TLS, the server also asks the client for one, and the client signs the handshake with the matching private key.

Encryption is unchanged, and both ends are authenticated before any application data flows. Servers use it when they must know which machine is calling: service-to-service traffic, partner APIs, and OAuth clients under RFC 8705.

TLS vs mTLS: only the client’s proof is new

mTLS is not a separate protocol. It is TLS with client authentication switched on, using messages TLS already defines. Cipher suites, key exchange and record encryption are identical. What differs is who proves identity, what the client must hold, and what happens when it holds nothing.

TLS (server authentication only) mTLS (mutual authentication)
Who proves identity The server The server and the client
Extra handshake messages None CertificateRequest from the server; Certificate and CertificateVerify from the client
What the client holds A list of trusted CAs Trusted CAs, plus its own certificate and private key
Typical callers Browsers, any HTTPS client Services, load balancers, devices, partner systems
Client without a certificate Connects normally The server aborts the handshake or treats the client as unauthenticated
Operating cost One certificate per server A certificate per client, plus issuing, renewing and revoking them

To see what a client certificate contains, paste one into the certificate decoder.

The mTLS handshake adds three messages

In TLS 1.3 (RFC 8446), the server sends CertificateRequest. The client answers with Certificate, its chain, and CertificateVerify, a signature over the handshake so far. The signature proves the client holds the private key, not just the public certificate.

  1. ClientHello. The client offers protocol versions, cipher suites and a key share.
  2. ServerHello. The server completes the key exchange, and every handshake message after it, starting with EncryptedExtensions, is encrypted.
  3. CertificateRequest. The server asks for a client certificate, lists the signature algorithms it accepts and can name the CAs it trusts.
  4. Server Certificate, CertificateVerify and Finished. The server proves its own identity, as in ordinary TLS.
  5. Client Certificate. The client sends its certificate first, followed by any intermediates. If it sends an empty message, the server decides whether to continue without client authentication or abort with a certificate_required alert.
  6. Client CertificateVerify and Finished. The server verifies the client’s signature against the certificate’s public key.

TLS 1.2 (RFC 5246) uses the same three messages in a different order: CertificateRequest comes before ServerHelloDone, and the client sends CertificateVerify after ClientKeyExchange.

Trusting a CA does not authorize a client

A valid chain proves that a CA you trust issued the certificate (see what a certificate authority checks before it signs). It does not say which client is calling.

If your CA issues certificates to fifty services, a server that checks only the chain accepts all fifty. A correct mTLS server also matches the client’s identity against an exact list.

In a Java client, the list of CAs it trusts is its truststore, by default the JDK’s cacerts file. A private CA and its root are part of a PKI, which that page shows with a real chain.

Here is a fictional load-balancer certificate, in the fields the certificate decoder shows.

Sample client certificate (fictional values)
Subject
CN=lb01.acme.example, O=Acme Corp
Issuer
CN=Acme Internal CA, O=Acme Corp
Self-signed
no
Valid from
2026-11-01
Valid until
2027-11-01
Public key
EC (P-256)
Names (SAN)
DNS:lb01.acme.example
Key usage
digitalSignature
Extended key usage
clientAuth
CA
no

The server trusts Acme Internal CA and accepts only the identity lb01.acme.example. Five clients connect:

Presented Verdict Why
The certificate above Accepted Chains to the trusted CA, in date, clientAuth, SAN listed exactly
*.acme.example from the same CA Refused A wildcard is not the listed identity
lb02.acme.example from the same CA Refused Right CA, wrong client: a CA alone is never enough
The certificate above, expired Refused Outside its validity period
No certificate Refused The server required one, so the handshake fails
  • Extended key usage: id-kp-clientAuth (RFC 5280) marks a certificate for client authentication.
  • The intermediate: the client sends its intermediates after its own certificate, or the server cannot build the chain.
  • Identity: nginx with ssl_verify_client on checks only the chain against ssl_client_certificate and leaves the subject in $ssl_client_s_dn for your own rule. RFC 8705 has each OAuth client register exactly one expected subject value. A SHA-256 public-key pin narrows acceptance to one key.

To try the five cases, create a “TLS client” certificate in the self-signed certificate generator, or start a CA-signed one with a certificate signing request.

For a Java service, the client’s private key and certificate sit in a keystore and the CAs it trusts in a truststore.

The keytool command generator writes the commands to list, import and export them.

mTLS proves one hop, not the whole path

mTLS authenticates the two ends of one TCP connection. When a reverse proxy or load balancer terminates TLS, the client’s certificate stops there. The backend sees a new connection from the proxy and can authenticate only the proxy, not the original client.

Before: the proxy terminates TLS. The client proved its identity to the proxy only. The backend cannot tell who the client is, or that the request came through the proxy. RFC 8705 states that how certificate data travels from such an intermediary to the application is out of scope.

After: the proxy presents its own client certificate. The backend checks the proxy’s identity exactly, as in the verdict table. Each hop is authenticated.

Callers whose identity is the certificate itself must connect without a terminating proxy.

mTLS and OAuth work at different layers

mTLS authenticates a connection; OAuth authorizes a request with a token. RFC 8705 combines them: mTLS authenticates the OAuth client at the token endpoint and binds its access token to the certificate. DPoP (RFC 9449) binds a token to a key at the HTTP layer, with no client certificate.

mTLS client authentication (RFC 8705) Certificate-bound tokens (RFC 8705) DPoP (RFC 9449)
Layer TLS, at the authorization server TLS, at the authorization and resource servers HTTP, a signed JWT in the DPoP header
What is bound The OAuth client to its certificate The access token to the certificate, as cnf with x5t#S256 The token to a public key, as cnf with jkt
Where it breaks A proxy that terminates TLS A proxy that terminates TLS Not tied to the connection, so TLS termination does not affect it
Browser fit Poor: browsers handle client certificates through a user prompt Poor, for the same reason Usable in browser and native apps

DPoP constrains who can use a token; it does not authenticate the client. By default, an SSOGEN MCP server route accepts only DPoP-bound tokens from AI agents. Read DPoP explained for the proof format. Between services, SPIFFE and SPIRE issue the workload certificates that mTLS uses.

Where SSOGEN uses mutual TLS

SSOGEN Gateways, and the load balancers in front of them, prove their identity with certificates.

  • SSOGEN Gateway to SSOGEN Each Gateway presents its certificate directly to SSOGEN’s own HTTPS port.
  • Load balancer to a Gateway listener Only your balancer connects, with a client certificate whose SAN matches a listed identity exactly (lb01.acme.example or a spiffe:// URI). A wildcard does not match, and a CA alone is never enough. Optional SHA-256 public-key pins are supported.
  • Ingress to the check port With forward authentication, your ingress sends each check to the Gateway’s check port over mutual TLS.

See SSOGEN Gateway, and section 9 of publish an internal app with the App Proxy for the listener setup.

A Java client that fails when a server demands its certificate is covered in javax.net.ssl.SSLHandshakeException.

Questions people ask

Are TLS and mTLS the same?

No. In mTLS the server also requires a client certificate and checks it, so a client without one is refused or treated as unauthenticated. Public HTTPS sites do not ask browsers for certificates, so most TLS you meet is one-way. The side-by-side table lists the differences.

Is mTLS better than OAuth?

Neither replaces the other. mTLS proves which client opened a connection; OAuth decides what a request may do, using tokens. They combine, for example in certificate-bound tokens under RFC 8705. When TLS client certificates are impractical, as in browsers, DPoP binds the token instead. See mTLS and OAuth.

Do I need a TLS certificate?

Every server that offers HTTPS needs a TLS certificate for its hostname, and public sites need one from a publicly trusted CA. A client needs its own certificate only when the server requires mTLS. For tests, a self-signed certificate works if the other side trusts it explicitly.

What is SSL and TLS?

TLS (Transport Layer Security) is the protocol that encrypts and authenticates connections such as HTTPS. SSL (Secure Sockets Layer) is its predecessor; the name survives in tools and product names, but SSL 3.0 is deprecated (RFC 7568). The current version is TLS 1.3, defined in RFC 8446. Certificates called “SSL certificates” are used with TLS.

More identity explainers are on the Learn hub. Before a CA signs a client certificate, check the request in the CSR decoder.

References (sources, all read 2026-11-17):

Updated