Client Certificate Authentication at CDN Edge Infrastructure
Client certificate authentication — mutual TLS (mTLS) — is the strongest form of transport-layer authentication available on the web. Unlike passwords or API keys that prove knowledge of a secret, client certificates prove possession of a private key that never leaves the client device. When mTLS is terminated at the CDN edge, the edge server validates the client's cryptographic identity before any application-layer processing begins, providing authentication at the lowest possible layer of the request stack.
How Mutual TLS Works at CDN Edge
In a standard TLS handshake, only the server presents a certificate. The client verifies the server's identity but the server does not verify the client's identity — it only knows that the TLS connection is encrypted. In mutual TLS, the handshake includes an additional step: the server sends a CertificateRequest message to the client, the client responds with its certificate, and the server validates the certificate before completing the handshake.
The mTLS Handshake at CDN Edge
When a client connects to a CDN PoP configured for mTLS, the edge server performs the following during the TLS handshake:
- ServerHello + CertificateRequest: The edge sends its server certificate and requests a client certificate, specifying which certificate authorities (CAs) it trusts. The trusted CA list is configured per domain in the CDN's mTLS settings.
- Client Certificate: The client sends its certificate chain (leaf certificate plus any intermediate CA certificates). If the client does not have a certificate, it can send an empty certificate message — the edge can either reject the connection or continue without client authentication, depending on configuration.
- Certificate Verification: The edge validates the client certificate: chain building (finding a path from the client cert to a trusted root), signature verification (each cert signed by its issuer), validity period (not expired, not yet valid), revocation status (CRL or OCSP check), and usage constraints (key usage and extended key usage include client authentication).
- Identity Extraction: After successful validation, the edge extracts identity information from the certificate: the Subject Distinguished Name (DN), serial number, issuer, fingerprint (SHA-256 hash), and any Subject Alternative Names (SANs). This information is forwarded to the origin as HTTP headers.
Certificate Chain Validation at Scale
CDN edge nodes serve thousands of mTLS connections per second. Certificate chain validation must be both thorough and fast to maintain acceptable connection latency.
| Metric | Edge Processing | Origin Processing | Improvement |
|---|---|---|---|
| Latency (p50) | 8–15 ms | 120–300 ms | 15–20x faster |
| Cache Hit Ratio | 85–95% | N/A | Reduces origin load |
| TLS Handshake | 1–5 ms (nearby PoP) | 50–150 ms | 10–30x faster |
| Bandwidth Cost | $0.01–0.04/GB | $0.05–0.12/GB | 3–5x cheaper |
| Availability | 99.99% (multi-PoP) | 99.9% (single DC) | 10x fewer outages |
Chain Building
The edge server must build a certificate chain from the client's leaf certificate to a trusted root CA. The client typically sends its leaf certificate and any intermediate CA certificates. The edge supplements these with its own intermediate CA store to complete the chain if the client omits intermediates (common in IoT devices with limited storage).
Chain building can be computationally expensive when multiple chain paths are possible (a certificate signed by a cross-certified CA may have multiple valid chains). CDN edge implementations typically cache valid chains, keyed by the leaf certificate's issuer and serial number, to avoid rebuilding on repeated connections from the same client.
Signature Verification
Each certificate in the chain is signed by its issuer using the issuer's private key. The edge verifies each signature using the issuer's public key (from the next certificate in the chain). For RSA-2048 signatures, verification takes approximately 0.1ms per certificate. For ECDSA P-256 signatures, verification is slightly faster. A typical chain of 3 certificates (leaf + intermediate + root) adds 0.3–0.5ms to the handshake.
Key Usage Validation
The client certificate must include the digitalSignature key usage and the clientAuth extended key usage OID (1.3.6.1.5.5.7.3.2). Certificates without these usages are valid X.509 certificates but are not authorized for client authentication. The edge rejects certificates missing the required usages, even if the chain is otherwise valid.
Certificate Revocation at CDN Edge
A valid certificate may need to be revoked before its expiration — the private key was compromised, the employee left the organization, or the device was decommissioned. CDN edge nodes must check certificate revocation status on every mTLS handshake.
CRL-Based Revocation
Certificate Revocation Lists (CRLs) are files published by the CA listing all revoked certificates' serial numbers. The CDN edge downloads the CRL periodically and checks the client certificate's serial number against the list. CRLs are simple but have scalability issues: a CA with millions of certificates can have large CRLs (megabytes), and the download frequency creates a window where a revoked certificate is still accepted (the CRL hasn't updated yet).
CDN edge nodes cache CRLs at each PoP with the CRL's nextUpdate time as the cache TTL. When the CRL expires, the edge downloads a fresh copy. For high-security environments, the edge can check CRLs more frequently (every hour rather than waiting for nextUpdate, which may be days).
OCSP-Based Revocation
The Online Certificate Status Protocol (OCSP) provides real-time revocation checking. The CDN edge sends the client certificate's serial number to the CA's OCSP responder and receives a signed response: "good" (not revoked), "revoked" (revoked, with reason and date), or "unknown" (the OCSP responder does not know the certificate). OCSP provides up-to-date revocation status but adds a network round-trip to the handshake (50–200ms to reach the OCSP responder).
CDN edge nodes optimize OCSP through caching: the OCSP response includes a nextUpdate time, and the response is cached at the edge until that time. Subsequent connections from different clients with certificates from the same CA can reuse the cached OCSP response (if the OCSP responder supports per-serial responses, each serial's response is cached separately).
OCSP Stapling
OCSP stapling eliminates the edge-to-OCSP-responder round-trip by having the certificate holder pre-fetch the OCSP response and include it in the TLS handshake. For client certificates, this means the client includes its OCSP response in the Certificate message. The edge validates the OCSP response's signature (using the OCSP responder's certificate) and checks the status without any external network call.
Client-side OCSP stapling is less common than server-side stapling because many client implementations do not support it. When client stapling is not available, the CDN edge falls back to OCSP lookup with caching or CRL checking.
Certificate Identity Forwarding to Origin
After the CDN edge validates the client certificate, the origin server needs the client's identity to make authorization decisions. The edge forwards certificate information to the origin as HTTP headers, since the origin does not have access to the TLS session that was terminated at the edge.
Standard Headers
CDN platforms typically forward the following headers: X-Client-Cert-DN (the certificate's Subject Distinguished Name, e.g., CN=device-001,O=IoT Corp,C=US), X-Client-Cert-Serial (the certificate's serial number), X-Client-Cert-SHA256 (the SHA-256 fingerprint of the certificate), X-Client-Cert-Issuer-DN (the issuer's Distinguished Name), and X-Client-Cert-Not-After (the certificate's expiration date).
The origin should validate that these headers come from the CDN edge and not from a malicious client. The CDN-to-origin connection should use a separate mTLS session or shared secret to ensure header authenticity. Without this validation, a client could spoof the X-Client-Cert-DN header by connecting directly to the origin, bypassing the CDN's certificate validation.
IoT Device Authentication at CDN Edge
IoT devices are a primary consumer of client certificate authentication through CDN infrastructure. Each device holds a unique client certificate provisioned during manufacturing, and the CDN edge validates the certificate on every connection. This provides strong device identity without passwords or API keys that could be extracted from the device firmware.
CDN architectures for IoT mTLS handle several IoT-specific challenges: devices may have limited TLS stack capabilities (older TLS versions, limited cipher suites), device certificates may be issued by private CAs (not publicly trusted), and the number of unique certificates may be very large (millions of devices, each with a unique certificate).
The CDN edge handles private CA trust by configuring per-domain trust anchors. The IoT platform's private CA is added to the CDN domain's trusted CA list, allowing the edge to validate certificates from that CA without the certificates being publicly trusted. This is the correct approach for IoT — device certificates should not be issued by public CAs because the public CA's revocation and issuance policies are designed for human users, not devices.
Certificate Lifecycle Management
Client certificates have a limited lifetime (typically 1–5 years for device certificates, 1–2 years for user certificates). The CDN edge must handle certificate renewal, revocation, and reissuance without disrupting active connections.
Certificate renewal can be handled transparently: the device or user obtains a new certificate before the current one expires, and the CDN edge accepts both the old and new certificates during an overlap window. The edge worker can track certificates nearing expiration and add a response header (X-Cert-Renewal-Required: true) prompting the client to initiate renewal through the organization's provisioning system.
For large-scale IoT deployments, the CDN edge's monitoring dashboard should track certificates by expiration date, alerting when a significant number of device certificates are approaching expiration. A sudden increase in certificate validation failures may indicate a CA infrastructure issue, certificate expiration, or a revocation event affecting many devices.