CDN mTLS Authentication in Practice: Securing Origin with Mutual TLS
Create Time:2026-07-13 16:07:23
浏览量
1047

CDN mTLS Authentication in Practice: Securing Origin with Mutual TLS

微信图片_2026-07-13_160619_903.png

Last year, a client’s origin IP was scanned and discovered by an attacker. They had WAF, hotlink protection, and IP blacklisting configured at the CDN layer. But the attacker bypassed the CDN entirely and made requests directly to the origin IP. The origin had no protection and was immediately overwhelmed.

“We’ve configured all this CDN security,” said the security lead. “Why did the origin still get hit?”

This is the blind spot of CDN security architectures: CDN blocks attacks at the edge, but if the origin IP is exposed, attackers can bypass the CDN entirely. Mutual TLS (mTLS) is designed to close this gap.

01 Why CDN Edge Protection Alone Isn’t Enough

In a standard CDN architecture, user requests pass through CDN edge nodes before reaching the origin. The CDN layer can enforce WAF, hotlink protection, and IP blacklisting – but these controls only apply to traffic that goes through the CDN.

The core problem: The origin itself remains exposed on the public internet. Attackers can discover origin IPs through DNS history, certificate transparency logs, or port scanning, and then attack the origin directly.

One common intuition is to deploy another WAF instance in front of the origin. But this has a fundamental flaw: the origin receives two types of traffic – requests forwarded by CDN (real client IPs passed via X-Forwarded-For headers) and direct internet requests (TCP source IPs that may be spoofed). Mixing these two traffic flows increases both false positives and false negatives for WAF rules like rate limiting, geographic blocking, and anti-DDoS protections.

The correct approach is to ensure that only CDN traffic reaches the origin, blocking direct connections at the transport layer.

02 How mTLS Protects the Origin

mTLS extends standard TLS by requiring both the client and the server to authenticate each other’s identities.

Origin mTLS in detail:

In standard origin HTTPS, only the CDN node verifies the origin’s server certificate. When origin mTLS is enabled, the origin also verifies the client certificate presented by the CDN node. The flow works as follows:

  1. The CDN node initiates a connection to the origin

  2. The origin returns its server TLS certificate, which the CDN node validates

  3. The CDN node presents its client certificate

  4. The origin validates the client certificate using the configured CA certificate

  5. Once both sides are validated, an encrypted channel is established

The effect: The origin only accepts requests that present a valid client certificate from a CDN edge node. Any direct connection attempt without a valid certificate is rejected at the TLS handshake stage – even if the origin IP is exposed.

This is an essential layer of a defence-in-depth strategy, and can be used alongside origin IP whitelisting to further reduce the attack surface.

03 Configuration Steps

Prerequisite: The origin must already have HTTPS enabled with server certificate validation configured.

Step 1: Prepare the CA certificate

You need the client CA certificate – the root or intermediate CA certificate used to sign client certificates. Format requirements: must start with -----BEGIN CERTIFICATE----- and end with -----END CERTIFICATE-----. Using a private CA with automated rotation is strongly recommended over long-term static certificates.

Step 2: Install the CA certificate on the origin

Install the client CA certificate on your origin server. For Nginx:

text

ssl_client_certificate /path/to/ca.crt;  # Client CA certificate
ssl_verify_client on;                     # Enable client certificate verification

Step 3: Enable mTLS on the CDN platform

Alibaba Cloud ESA/全站加速: In the domain HTTPS configuration, enable origin mTLS authentication and upload the CA certificate.

Tencent Cloud EdgeOne: The platform supports origin server certificate verification, with the ability to specify trusted CA certificates for origin certificate validation.

AWS CloudFront: Import the client certificate via ACM and enable origin mTLS in the Distribution origin configuration.

Verification: Once configured, a request from the CDN edge with a valid client certificate should succeed. A direct request to the origin without a certificate should fail at the TLS handshake.

The Bottom Line

That client enabled origin mTLS after the incident. The origin now only accepts encrypted requests from CDN edge nodes with valid client certificates. When attackers re-scanned the origin IP, their direct connections were rejected at the TLS handshake.

“The origin used to be wide open,” the security lead later said. “Now there’s an extra lock – and only the CDN has the key.”

mTLS is not a replacement for WAF or hotlink protection – it’s the final piece that secures the origin itself, ensuring that even if the origin IP is exposed, attackers can’t get in.