Set up mutual TLS (mTLS) between two services

domain: developers.cloudflare.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Create or obtain a private certificate authority (CA) whose certificates will be trusted by both services; generate CA key material and a self-signed CA certificate using a tool such as openssl or cfssl, storing the CA private key securely in a secrets manager
  2. Issue a server certificate signed by your CA for the server-side service, and issue a separate client certificate signed by the same CA for the calling service; embed the Subject Alternative Name (SAN) matching the server's hostname in the server certificate
  3. Configure the server to present its certificate and to require client certificate verification; provide the CA certificate (or bundle) as the trusted root so the server can validate client certs
  4. Configure the client to present its certificate and private key on outbound connections, and to verify the server certificate against the same CA bundle
  5. Test the connection with a tool that supports client certificate authentication; verify that a connection without a client certificate is rejected with a TLS handshake error, not a 401 or 403
  6. Automate certificate rotation before expiry: issue new client and server certificates, deploy them, and revoke the old ones; maintain a CRL or OCSP responder if runtime revocation is required

Known gotchas

Related routes

Configure Istio mutual TLS (mTLS) in STRICT mode across a namespace and verify enforcement with istioctl
istio.io · 6 steps · unrated
Stand up SPIRE server and agents to issue X.509-SVIDs for automatic mTLS between two services
spiffe.io · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans