CDN Mutual TLS: Two-Way Certificate Authentication

· James Thornton · 4 min read

What Is Mutual TLS

In standard TLS, only the server presents a certificate. In mutual TLS (mTLS), both sides present certificates — the server authenticates to the client AND the client authenticates to the server. For CDNs, mTLS is used in two scenarios: CDN-to-origin authentication and client-to-CDN authentication. For foundational context, read CDN DDoS Protection: How CDNs Absorb Volumetric Attacks — FlyFish NWA.

CDN-to-Origin mTLS

The CDN presents a client certificate when connecting to your origin. Your origin verifies the certificate before accepting the connection. This ensures only authorized CDN servers can access your origin.

Performance Comparison: Edge vs Origin Processing
Metric Edge Processing Origin Processing Improvement
Latency (p50)8–15 ms120–300 ms15–20x faster
Cache Hit Ratio85–95%N/AReduces origin load
TLS Handshake1–5 ms (nearby PoP)50–150 ms10–30x faster
Bandwidth Cost$0.01–0.04/GB$0.05–0.12/GB3–5x cheaper
Availability99.99% (multi-PoP)99.9% (single DC)10x fewer outages
CDN Security Architecture — Defense-in-depth protection layersCDN Security Architecture — Defense-in-depth protection layers CDN Security Layers — Defense in Depth DDoS Mitigation Web Application Firewall Bot Detection & Rate Limiting SSL/TLS Encryption Origin Server DDoS ✕ Attack ✕ SQLi ✕ PROTECTED
Figure 1: CDN Security Architecture — Defense-in-depth protection layers
# CDN → Origin connection with mTLS:
1. CDN edge connects to origin
2. Origin sends its server certificate (standard TLS)
3. Origin requests client certificate (mTLS step)
4. CDN sends its client certificate
5. Origin verifies: Is this a valid CDN certificate?
6. If yes → connection established
7. If no → connection rejected

This is the strongest form of origin protection. Even if an attacker knows your origin IP, they can't connect without the CDN's client certificate.

Setting Up CDN-to-Origin mTLS

Cloudflare Authenticated Origin Pulls

  1. Download Cloudflare's client certificate (origin-pull-ca.pem)
  2. Configure your origin to require this certificate
  3. Enable Authenticated Origin Pulls in Cloudflare dashboard
# Nginx origin configuration
server {
    listen 443 ssl;
    ssl_certificate /path/to/server.crt;
    ssl_certificate_key /path/to/server.key;

    ssl_client_certificate /path/to/cloudflare-origin-pull-ca.pem;
    ssl_verify_client on;
}

CloudFront Origin mTLS

CloudFront does not natively support mTLS to origin. Workaround: use Lambda@Edge to add a client certificate, or use a header-based authentication approach.

Client-to-CDN mTLS

The CDN requires clients to present certificates. Used for:

Secure Request Flow — How requests pass through security layersSecure Request Flow — How requests pass through security layers CDN Request Flow — From Browser to Edge CDN Request Lifecycle Step 1 DNS Lookup Step 2 TCP Connect Step 3 TLS Handshake Step 4 Edge Server Step 5 Cache Check Step 6 Response Cache HIT → 5ms response Cache MISS → Fetch origin 0ms ~50ms (cache hit) ~200ms (cache miss)
Figure 2: Secure Request Flow — How requests pass through security layers

Certificate Management

mTLS adds certificate management overhead:

mTLS vs Other Auth Methods

MethodSecurityComplexityBest For
mTLSHighestHigh (certificate management)Origin protection, M2M APIs
Shared secret headerMediumLowSimple origin authentication
IP allowlistMediumLowKnown, static IP ranges
JWT validationHighMediumUser-facing APIs

See token authentication and Zero Trust for complementary approaches.

Performance Impact

mTLS adds one additional round-trip to the TLS handshake (for client certificate exchange). With connection pooling between CDN and origin, this overhead is amortized across many requests. CDN-to-origin mTLS has negligible performance impact because CDN connections are persistent.

External References

References & Standards: RFC 7234 · W3C Web Performance