liveBook · Manning

Mutual TLS

As explained in Secure APIs

Mutual Transport Layer Security is a TLS configuration in which both communicating parties authenticate each other with certificates.

Mutual Transport Layer Security (mTLS) is a TLS configuration in which the server and client authenticate each other with certificates. During the handshake, the client sends a public certificate and proves ownership by signing a message with its private key. This helps prevent a stolen access token from being used by an attacker who lacks the legitimate client certificate. section 7.5.1 section 7.5

Figure 7.12 MTLS requires the client (such as a browser) to provide its own certificate to verify its identity.
figure

Use the handshake illustration to see how the client certificate adds client authentication to ordinary TLS. section 7.5.1

For OAuth, mTLS binds an access token to a specific client certificate. The authorization server records the certificate details, derives a thumbprint, and places it in the token’s cnf confirmation claim. A client must therefore present the corresponding certificate when using the token. section 7.5.1 section 7.8

Certificate-bound JWT

A JWT can carry a cnf claim containing an x5t#S256 value: {"cnf":{"x5t#S256":"bwcK0esc3ACC3DB2Y5_lESsXE8o9ltc05O89jdN-dg2"}}. The value identifies the client certificate bound to the token. section 7.5.1

How Secure APIs covers it

How deep it goes
Explains the TLS handshake, client proof of private-key ownership, certificate thumbprints, and the JWT cnf claim.
Examples
Uses browser-server handshake figures and a JWT containing an x5t#S256 certificate-thumbprint confirmation claim.
What it assumes
Builds TLS and certificate verification from the handshake, while assuming familiarity with API access tokens and OAuth.
What you can do after
Apply it to bind OAuth access tokens to client certificates and reduce misuse after token leakage.
How it connects
Connects TLS, OAuth, sender-constrained tokens, access tokens, JWT, and DPoP.

Also explained in

Compare how 8 books explain mutual TLS →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Secure APIs. The section links point to the parts of the book it draws on.