Whenever we visit a website over HTTPS, our browser verifies the server’s identity through its TLS certificate. But why isn’t the reverse usually required? Why does the browser need to know who the server is, while the server doesn’t need to know who’s connecting to it?
To understand this, let’s first look at what TLS provides.
TLS establishes a secure communication channel between two parties. It provides authentication, confidentiality, and integrity, ensuring that we’re communicating with the intended server and that data cannot be read or tampered with by an attacker on the network. However, in a typical HTTPS connection, only the server is authenticated through a certificate. The server doesn’t normally authenticate the client at the TLS level.
Consider a bank exposing an API that allows other financial institutions to exchange sensitive information. While TLS protects communication with the bank, it doesn’t establish the identity of the caller. Anyone could attempt to connect to the API. The bank could authenticate callers using API keys or OAuth tokens, but what if it wanted to authenticate the client before processing any HTTP requests?
This is where mutual TLS (mTLS) comes in.
How does mTLS work?
mTLS isn’t a separate protocol. It’s TLS with certificate-based authentication on both sides.
In an ordinary HTTPS connection, the server presents its certificate and proves possession of the corresponding private key. With mTLS, the server additionally requests a certificate from the client. Both parties validate each other’s certificates according to their trust policies and verify possession of the corresponding private keys during the handshake.
If either party fails the required authentication, the connection is rejected.
Why isn’t a certificate alone enough?
To understand how this authentication works, we first need to understand the relationship between certificates and private keys.
A certificate contains a public key associated with an identity. In a typical Public Key Infrastructure (PKI), a Certificate Authority (CA) digitally signs the certificate to attest to this relationship. The receiver validates the certificate’s signature using the issuing CA’s public key and follows the certificate chain to a trusted CA.
However, certificates contain public information. Anyone could obtain a copy of a certificate and attempt to present it as their own. So how does the receiver know that the caller actually owns the corresponding private key?
This is where digital signatures come in.
During a TLS 1.3 handshake, the certificate holder signs handshake data using its private key. The receiver verifies this signature using the public key contained in the certificate. This proves possession of the corresponding private key without revealing it.
The important distinction is that we’re verifying two different things:
- Can we trust the claimed identity? The certificate and its chain of trust establish the relationship between an identity and a public key.
- Can the caller prove possession of the private key? The digital signature demonstrates control of the private key associated with that public key.
These two checks together form the basis of certificate-based authentication. The signature covers TLS handshake data, not the HTTP request body itself.
Why don’t we use mTLS everywhere?
If mTLS allows both parties to authenticate each other, why isn’t it used by every website?
Browsers actually support client certificates, but managing them introduces significant complexity. Imagine having to obtain and install a certificate on every device before accessing a website, while also dealing with certificate expiration, renewal, and revocation.
Furthermore, authenticating a client certificate doesn’t necessarily identify the person using the device. For most consumer applications, conventional login sessions and authentication methods such as passwords or passkeys are more practical.
mTLS becomes much more attractive in controlled environments where the participating systems are known and their certificates can be managed centrally.
Where does mTLS make sense?
mTLS is particularly useful in machine-to-machine communication, especially between financial institutions.
For example, a bank exposing an API to Payment Service Providers (PSPs) can require each PSP to present a trusted client certificate before accepting requests. This allows the bank to authenticate the connecting PSP at the TLS layer.
However, authentication doesn’t necessarily mean authorization. Knowing which PSP is connecting doesn’t tell the bank what operations it should be allowed to perform.
This is where OAuth can complement mTLS. While mTLS authenticates the connecting client, OAuth access tokens can convey the permissions granted to that client.
OAuth also supports certificate-bound access tokens, where an access token is associated with a particular client certificate. This prevents someone who steals the token from using it without possession of the corresponding private key. However, this binding must be explicitly implemented and doesn’t happen automatically just because mTLS is enabled.
Conclusion
mTLS doesn’t introduce an entirely new authentication mechanism. It uses the same certificate-based authentication principles already present in ordinary HTTPS, but applies them to both parties.
What I find most useful about this concept is that certificate-based authentication ultimately comes down to two questions: can we trust the identity associated with this public key, and can the caller prove possession of its corresponding private key?
mTLS provides a way for both sides to answer these questions during the TLS handshake. The trade-off is the additional complexity of issuing, managing, and trusting client certificates.
For systems where client identity matters as much as server identity, that trade-off can be worthwhile.