Mutual TLS (mTLS): verify API callers with client certificates
Understand TLS 1.3 client-certificate authentication, how it differs from API authorization, and how RFC 8705 certificate-bound OAuth tokens and certificate operations fit.
Mutual TLS (mTLS): verify API callers with client certificates
Mutual TLS (mTLS) adds client authentication to ordinary TLS server authentication: the client proves its identity to the server with a certificate and the corresponding private key. The server checks its trust rules and identity mapping before accepting the connection. mTLS identifies a caller at the transport connection; separate application authorization decides what API actions that identity may perform.
What changes from ordinary TLS?
In ordinary HTTPS, the client validates the server certificate and hostname, and TLS protects traffic confidentiality and integrity. That alone does not require the server to identify every caller by certificate. With mTLS, the server requests a client certificate during the handshake and the client proves possession of the matching private key.
In TLS 1.3, the server sends CertificateRequest when it needs client authentication. The client returns a certificate and signs handshake data in CertificateVerify; both sides validate Finished before completing the handshake. If the server does not request a client certificate, these client-authentication messages are absent. HTTPS alone is therefore not evidence that mTLS is enabled.
| Connection property | Server-authenticated TLS | mTLS |
|---|---|---|
| Server authenticates client by certificate | Not required by default | Client certificate requested and checked according to policy |
| Client verifies server certificate | Yes | Still required |
| Encryption and integrity | TLS provides them | TLS provides them |
| API permissions | Separate policy | Still separate policy |
Certificates can be public; their private keys must remain secret. The server validates a trusted chain or registered public key and verifies proof of private-key possession. The operator must also map certificate subject/SAN to a service identity; organizations may trust different issuers or interpret names differently.
Hypothetical example: a batch job calls a payment API
This is an explanatory hypothetical, not a report of a tested product. A nightly batch sends settlement results to a payment API. Ordinary TLS lets the batch verify the API server certificate. With mTLS, the payment service also checks the batch client certificate, its chain and identity mapping, and the handshake proof that the caller holds the private key. An untrusted, expired, or unmapped certificate is rejected at connection time.
A successful connection still does not authorize every operation. The API might allow the batch identity to submit settlement results while denying delete on payment accounts. mTLS narrows which key-proven caller connected; application policy decides which business action is allowed.
What changes with OAuth tokens?
An OAuth access token is commonly a bearer token: whoever holds it may use it. RFC 8705 defines both mTLS OAuth client authentication and access tokens bound to a client certificate. A resource server supporting certificate-bound tokens checks that the certificate on the TLS connection matches the certificate bound to the token. A stolen token alone is then insufficient without the matching private key.
These are distinct, complementary features. mTLS client authentication at the token endpoint authenticates the OAuth client. A certificate-bound token additionally proves at the protected resource that the caller possesses the corresponding key. An mTLS connection does not bind a token automatically; the issuer and API must support and verify that binding.
Certificate operations checklist
Define which API hosts and paths require client certificates, and whether ordinary clients are also served. Check whether an empty client-certificate list is mistakenly accepted.
Agree on trusted issuers, chains, SANs or registered public keys and how those values map to service identities.
Protect and distribute private keys through restricted runtime paths; keep them out of images, source repositories, shared files, logs and overly broad backups.
Plan renewal and retirement before expiry. For a key leak, reject the certificate, issue a new key, and review sessions, tokens and affected services.
Test a valid certificate and negative cases: no certificate, untrusted CA, expiry, name mismatch and a certificate paired with the wrong key. Then confirm that only intended API roles work.
If a proxy terminates TLS, verify how it conveys certificate identity to the backend. Do not trust client-supplied headers; protect the proxy-to-backend path and the integrity of forwarded metadata.
Log certificate subject/fingerprint, validity, identity mapping and rejection reason without recording private keys or full secret tokens.
| Symptom | Check | Safe response |
|---|---|---|
| Handshake is rejected | Missing certificate, chain, expiry, or accepted issuer | Compare the server trust policy with the intended environment certificate |
| mTLS connects but API returns 403 | Authentication succeeded; identity-to-role mapping or API policy differs | Review identity mapping separately from resource permissions |
| Works at proxy, identity missing at backend | TLS termination and certificate-metadata forwarding | Trust only an authorized proxy and protect the backend connection |
| Calls fail after certificate rotation | New chain deployment, trust-store update, or token binding mismatch | Use a controlled overlap and verify the actual server policy |
Choose mTLS only if the organization can operate certificate issuance, storage, rotation, emergency rejection, and trust configuration across API servers. It helps prove a workload or device identity, but a stolen private key or overly broad API permission remains a risk.
References
[RFC 8446: TLS 1.3](https://www.rfc-editor.org/rfc/rfc8446.html)
[RFC 8705: OAuth 2.0 Mutual-TLS Client Authentication and Certificate-Bound Access Tokens](https://www.rfc-editor.org/rfc/rfc8705.html)