How Mutual TLS Uses a Client Certificate
See what the client and server each verify in mutual TLS, and distinguish a failed handshake from an authenticated request that lacks permission.
- tls
- mtls
- certificates
- guide
Mutual TLS (mTLS) uses a TLS handshake to authenticate both endpoints. The client verifies the server certificate. The server requests a client certificate and checks the client's proof that it holds the corresponding private key. A service can then use that client identity when it decides which requests to allow.
Give each side a trust decision
Imagine an internal report worker calling a billing API. The worker needs to trust the issuer of the API's server certificate and check the API's hostname. The API's TLS endpoint needs to trust the issuer of the worker's client certificate and check that the certificate meets its client identity and usage rules. The two trust configurations can use different authorities.
In TLS 1.3, the CertificateRequest message asks for the client certificate. A CertificateVerify signature proves possession of the corresponding private key. Giving two workers the same key removes a useful distinction between identities, so issue and rotate credentials per workload where practical.
Identify which check failed
| Observation in this example | What to examine first |
|---|---|
| Worker refuses to connect and reports an untrusted server issuer | The API's served chain and the worker's trust store |
| API's TLS endpoint says a client certificate is required | Whether the worker configured a client certificate and key for this endpoint |
| API's TLS endpoint rejects a supplied client certificate | Client certificate expiry, chain, accepted issuer, usage and identity rules |
| Worker completes TLS and gets an application denial | Which identity the API received and which actions its policy grants |
When a gateway terminates TLS, use that gateway's handshake logs for certificate checks. Then verify how it passes the authenticated identity to the application. The application needs a trusted path for that identity so it does not treat an arbitrary request header as proof of a client certificate.
Give rotation an acceptance test
Install a replacement client certificate and key on one staging instance. Use a test report and an isolated test record to confirm that the allowed read succeeds and that the forbidden write is blocked. If the issuing CA is also changing, test the intended old and new trust paths during the transition and remove the old trust after the migration completes. Monitor the expiry of the CA and the leaf certificates separately.
Client certificate authentication can coexist with additional authorization rules. One example, OAuth mutual TLS in RFC 8705, treats client authentication and certificate-bound access tokens as distinct mechanisms. In the billing example, the certificate identifies the worker. The API policy still decides which reports the worker can read.
