Design a Large-Scale SSL/TLS Offloading

Hard45 min
1 / 29
System design answer

Design a Large-Scale SSL/TLS Offloading

Hard45 min29 sections
understanding•11 min read

Problem Statement: TLS Termination as a Distributed Security Boundary

Frames SSL/TLS offloading as a security-critical edge infrastructure problem, not merely an HTTPS checkbox.

Problem Statement

Design a large-scale SSL/TLS offloading platform that terminates encrypted connections at the network edge, decrypts and inspects traffic, optionally re-encrypts toward backends, manages the full certificate lifecycle across thousands of domains, protects private keys using hardware security modules, routes requests using SNI-based multiplexing, and sustains millions of concurrent TLS sessions with sub-millisecond handshake overhead.

This is not a single load balancer with a certificate. At the scale of Cloudflare, which reported processing over 57 million HTTP requests per second across 300+ cities in 2024, or AWS Elastic Load Balancing handling millions of concurrent TLS connections per region, TLS termination becomes a distributed systems problem with cryptographic constraints. Every handshake involves asymmetric operations (RSA-2048 signing costs approximately 1 millisecond on a modern core; ECDSA P-256 costs roughly 0.3 milliseconds), and at 100,000 new connections per second, a single node would need 100 cores dedicated solely to handshake cryptography before forwarding a single byte of application data.

Why This Problem Is Distinctive

A typical web backend can retry a failed request. A TLS termination layer cannot retry a compromised key. The design therefore separates connection throughput from key safety. Throughput is an eventually scalable metric: add nodes, add edge locations, add hardware accelerators. Key safety is an invariant: private keys must never leave the HSM boundary in plaintext, certificate revocation must propagate within the OCSP validity window, and session ticket keys must rotate on a schedule that bounds the exposure of forward secrecy.

The problem requires load balancer TLS termination, certificate management with renewals and multi-domain support, optional backend re-encryption, SNI-based routing, high concurrency, HSM key protection, minimal encryption overhead, and geo-distributed local termination. These requirements span cryptography, distributed systems, hardware engineering, and operational security simultaneously.

The Four Architectural Planes

  1. Data plane: TLS handshake processing, symmetric cipher operations, session resumption, SNI inspection, and traffic forwarding. This plane must operate at line rate with hardware acceleration where available.
  2. Control plane: Certificate provisioning, renewal, revocation, SNI routing table updates, and configuration distribution. This plane is strongly consistent and audited.
  3. Key plane: HSM integration, key generation, key rotation, session ticket key distribution, and audit logging. This plane has the strictest access controls and the smallest blast radius.
  4. Observability plane: Handshake metrics, cipher suite distribution, certificate expiry monitoring, OCSP response latency, session cache hit rates, and anomaly detection for handshake floods.

A strong interview answer keeps these planes separate. It allows the data plane to degrade (drop new connections, serve cached sessions) without weakening the key plane, and it permits the control plane to update certificates without disrupting active sessions.

Public Operating Baseline Versus Design Assumptions

Public evidence establishes that TLS offloading at extreme scale is operationally real. Cloudflare's engineering blog describes terminating TLS for approximately 20 percent of the web's HTTPS traffic, with BoringSSL as the cryptographic library and custom session ticket key distribution across their global edge. AWS documents that Application Load Balancer supports SNI-based routing with ACM-managed certificates and that Network Load Balancer can terminate TLS at Layer 4. Google's published Maglev paper describes their distributed software load balancer, and their Jupiter fabric paper details the network architecture that supports front-end TLS termination. Akamai's platform terminates TLS for enterprise customers at edge locations worldwide.

For capacity planning, this answer explicitly assumes a mature global platform with 50,000 edge termination nodes, 500 million TLS handshakes per day, 20 million concurrent TLS sessions at peak, 10,000 distinct domains, and a five-times event peak multiplier. Unless a number is tied to a citation, it is a stated design assumption, target, budget, or illustrative threshold.

Key Highlights

  • •TLS termination at scale is a distributed systems problem with cryptographic constraints, not a single proxy configuration.
  • •RSA-2048 handshake costs approximately 1ms per operation; at 100K new connections/sec, that is 100 dedicated cores before any data forwarding.
  • •The architecture has four planes: data, control, key, and observability.
  • •Key safety is an invariant; throughput is a scalable metric. They must not be coupled.
  • •Public figures from Cloudflare, AWS, and Google provide context; every uncited scale number in this answer is an explicit design assumption.
Lead With the Key Boundary
State in the first two minutes that private keys never leave the HSM in plaintext and that the data plane accesses cryptographic operations through a sign-only interface. This instantly distinguishes a security architecture from a generic proxy configuration.
Do Not Treat TLS as a Config Checkbox
A design that says 'put a cert on the load balancer' without addressing key protection, session resumption, SNI multiplexing, certificate rotation, and hardware acceleration will fail a serious infrastructure interview.

Section Rescue Kit

Buzzwords to use:

TLS TerminationForward Secrecy

Safe statements:

  • "I will separate connection throughput from key safety: the former scales horizontally, while the latter must fail closed."
  • "Before selecting hardware, let me define which operations happen at the edge, which require HSM access, and which can be cached."
Design a Large-Scale SSL/TLS Offloading - System Design | WinJob | WinJob