Course contentsShow
← System Design
Lesson 851 of 1,91922. Service MeshFree lesson

Mutual TLS (mTLS) Authentication

Automatic encryption and authentication between services using certificate-based identity and rotation.

Mutual TLS (mTLS) Authentication

What You'll Learn

You'll understand how service meshes automatically secure service-to-service communication by requiring both sides to prove their identity with certificates.

The Core Problem

In a microservices architecture, services constantly communicate with each other over the network. Without protection, any compromised service or malicious actor inside your network could intercept traffic or impersonate legitimate services. Traditional TLS only verifies the server's identity—the client remains anonymous.

What is mTLS?

Mutual TLS (mTLS) extends standard TLS by requiring both client and server to present valid certificates and verify each other's identity. In a service mesh, this happens automatically through the sidecar proxies.

How It Works

Think of mTLS like two diplomats meeting: both must show their credentials before sharing information. Here's the flow:

  1. Service A wants to call Service B
  2. Service A's sidecar proxy presents its certificate to Service B's proxy
  3. Service B's proxy presents its certificate back to Service A's proxy
  4. Both proxies verify the certificates against trusted Certificate Authority (CA)
  5. Only if both identities are valid does communication proceed—now encrypted

Automatic Certificate Management

Service meshes handle the heavy lifting:

  • Issuing certificates for each service identity
  • Rotating certificates automatically before expiration (often every 24 hours)
  • Distributing root CA information to all proxies
  • Revoking compromised certificates instantly

This happens transparently—your application code doesn't need to change at all. The control plane manages certificate lifecycle; the data plane enforces verification.

Benefits

mTLS provides authentication (verifying who you're talking to), encryption (protecting data in transit), and authorization foundation (you can create policies based on verified identities).

Key Takeaway: mTLS in a service mesh automatically encrypts all service-to-service traffic and ensures both parties prove their identity using short-lived certificates, eliminating the need for manual certificate management and securing your internal network by default.