Mutual TLS (mTLS) requires both the client and server to present certificates, establishing bidirectional authenticated encryption. The server proves its identity to the client (standard TLS), and the client proves its identity to the server (the mutual part). This eliminates the API key as an authentication mechanism — if a service can present a valid certificate signed by your internal CA, it is authenticated.
Why mTLS Is Stronger Than API Keys
API keys are bearer tokens — anyone who has the key can use it. Keys can be extracted from memory, leaked in logs, or stolen from key stores. An mTLS certificate is only useful in combination with the corresponding private key, which never leaves the machine it was generated on. Stolen certificate without private key = useless.
The Operational Cost
mTLS requires: an internal certificate authority (CA) or a managed PKI service, certificate provisioning for every service, certificate rotation before expiry (typically 90 days), revocation infrastructure, and debugging tools for certificate errors. Most teams significantly underestimate this operational burden. A certificate rotation failure that takes down inter-service communication at 2am is a real incident pattern.
When to Use mTLS
mTLS is clearly worth the complexity in: high-security environments where stolen API keys are a material risk, regulated industries where authentication strength is audited, and service meshes where it is implemented automatically (Istio, Linkerd). In these contexts, the operational tools for mTLS are already available.
When API Keys Are Fine
A well-implemented API key system — short-lived keys, scoped permissions, automatic rotation, audit logging on usage — is appropriate for most service-to-service authentication. The security delta between mTLS and well-managed API keys is real but small for most threat models.
G8KEPR supports mTLS for inbound connections to the API gateway. Certificate validation is handled at the edge, before requests reach any application code. Certificate metadata (issuer, subject, expiry) is attached to the request context for downstream authorization decisions.
