Skip to main content

Mutual TLS (mTLS)

Mutual TLS (mTLS) is a two-way authentication protocol where both client and server present certificates and verify each other before encrypted communication begins. In a service mesh, sidecar proxies apply mTLS between services automatically, with no application code changes.

Regular TLS vs mTLS

With regular TLS, as on a bank's website, only the server proves its identity. With mTLS the server also verifies the client, so a service accepts calls only from workloads it can cryptographically identify.

sequenceDiagram participant A as Orders sidecar participant B as Payments sidecar A->>B: ClientHello B-->>A: Server certificate A->>B: Client certificate B->>B: Verify identity A->>B: Encrypted request

How the mesh does it

Applications send plain HTTP to the local sidecar. The sidecars perform the mTLS handshake, encrypt traffic between pods, and decrypt it on arrival. The mesh CA issues short-lived certificates tied to each workload's ServiceAccount identity and rotates them automatically. In Istio, workload certificates default to a 24 hour lifetime.

Configure in Istio

YAML
apiVersion: security.istio.io/v1
kind: PeerAuthentication
metadata:
name: default
namespace: production
spec:
mtls:
mode: STRICT
Mode Behaviour
STRICT Only mTLS accepted
PERMISSIVE Both mTLS and plaintext accepted

Roll out with PERMISSIVE, verify with mesh telemetry that traffic is encrypted, then move namespace by namespace to STRICT.

Remember

mTLS proves identity and encrypts. It does not decide who may call whom. Add AuthorizationPolicy for that.

Security

Do not enable STRICT before every workload in scope has a sidecar. Anything without one, including probes and jobs, will be rejected.

Common Mistake

Believing mTLS replaces NetworkPolicy. They are complementary layers.

Frequently Asked Questions

How is mTLS different from the TLS on a public website?

Regular TLS verifies only the server. mTLS also verifies the client, so both sides are authenticated before data flows.

Why do I need to roll out PERMISSIVE first?

STRICT rejects plaintext. Pods without sidecars, external health checks, and legacy clients fail instantly. PERMISSIVE lets you migrate gradually and verify.

Does the application have to handle certificates?

No. The sidecars handle issuance, rotation, and the handshake, so application code stays unchanged.

Found a mistake, an outdated step or a broken link?