Skip to content

SSL offload at the LB vs end-to-end TLS: compliance, performance, observability

Terminating TLS at the load balancer is the default for a reason — but the wrong default for some workloads. Here's how to decide.

You deploy a new SaaS tier behind HAProxy. TLS terminates at the LB and traffic goes plaintext to backends on the private network. Six months later a SOC 2 auditor flags the unencrypted backend traffic, your CISO asks why customer health data crosses the data centre LAN in plaintext, and a senior engineer points out that the X-Forwarded-For chain has been getting trusted blindly the whole time. The architecture wasn’t wrong — it was uninspected. There is a legitimate version of “terminate TLS at the LB,” and a legitimate version of “encrypt end-to-end.” The wrong move is shipping either without thinking through the tradeoffs.

What’s happening

SSL offload at the LB (a.k.a. TLS termination) means the load balancer holds the public certificate and key, decrypts the request, and forwards plaintext to backends over the private network. The LB sees headers, cookies, the request body, and can route on any of them. Backends are simpler — they handle HTTP, not HTTPS. Cert rotation is one place. The cost: anyone on the private network with tcpdump access reads everything; you trust the network perimeter to be the security boundary.

End-to-end TLS (a.k.a. TLS passthrough or re-encryption) means the connection is encrypted to the backend. In passthrough mode, the LB doesn’t decrypt at all and is essentially a TCP load balancer — it cannot do HTTP path routing, cannot insert X-Forwarded-For, and cannot inspect headers. In re-encryption mode, the LB decrypts, inspects, then re-encrypts to a backend cert. You get LB-layer routing AND encrypted backend traffic — at the cost of two TLS handshakes per request and certs to manage on the backends.

Mutual TLS (mTLS) backend-side is re-encryption with backend-presented client certs from the LB. This is the answer for zero-trust networking: the backend rejects any request that doesn’t present an LB cert, even if someone gets a network foothold.

The three knobs that drive the decision: compliance (does plaintext traffic crossing your private network violate a policy or regulation?), performance (can you absorb double TLS overhead?), and observability (do you need WAF, header-based routing, and request logging at the LB?).

How to verify

Diagnose what your current setup is actually doing:

# 1. What is between the LB and the backend?
# On the backend, look at incoming connections:
ss -tn state established '( sport = :80 or sport = :8080 )' | head

# 2. Is the LB inserting X-Forwarded-Proto?
curl -s https://app.example.com/debug/headers \
  | jq '."x-forwarded-proto", ."x-forwarded-for"'

# 3. Capture backend traffic in a controlled window (with consent + scoped)
sudo tcpdump -i eth0 -w /tmp/backend-cap.pcap -G 30 -W 1 port 8080
# Open in Wireshark. If you see plaintext POST bodies, you're offloading.

# 4. Backend TLS cert chain (if re-encrypting)
openssl s_client -connect 10.10.0.21:8443 -servername backend.internal \
  -showcerts < /dev/null | openssl x509 -noout -subject -issuer -dates

Run the tcpdump check on a real environment with the data owner’s sign-off, even if it’s “your own” cluster. Capturing plaintext customer data unprompted is its own incident.

The fix

The decision rule we apply during onboarding:

  1. Regulated workloads (PCI-DSS card data, HIPAA, SOC 2 with explicit data-in-transit controls): end-to-end TLS, no exceptions. Use LB-layer re-encryption so you keep routing and WAF. Backend certs from an internal CA, rotated monthly via automation. The auditor’s question stops being “is it encrypted?” and becomes “show me the rotation log.”
  2. Public marketing site, static assets, low-sensitivity content: TLS termination at the LB. Simpler ops, faster handshakes, lower backend CPU. Document the trust boundary explicitly — “private VLAN A is the security boundary; backends accept HTTP only from LB IPs.”
  3. High-throughput APIs: usually termination at the LB, with a hard rule that backends only listen on the private interface and the perimeter is locked. If the LB and the backends live in the same VPC with an explicit deny on inbound from the public, the risk model is acceptable for most B2B SaaS.
  4. Zero-trust posture: mTLS backend-side. The LB presents a client cert, the backend rejects anything else. This adds operational complexity (cert lifecycle for every backend pool) but is the only architecture that survives “an attacker has a host in your VPC.”

Three details people miss:

  • TLS 1.3 0-RTT is not free — it weakens replay protection. Disable it on POST endpoints if your stack supports per-route policy.
  • Header trust on offload: the LB owns X-Forwarded-For, X-Forwarded-Proto, True-Client-IP. The backend MUST strip any client-supplied versions of these headers and only trust the LB-set ones. Otherwise anyone can forge their source IP in your logs.
  • HSTS enforcement belongs at the LB or the CDN, not the application. The application can set the header; only the edge can guarantee no plaintext redirect ever leaves.

Stack Harbor runs both terminating and end-to-end TLS architectures for B2B SaaS on managed cloud compute, including automated backend cert rotation and audit-ready logging. If your compliance posture is being driven by what the LB does today rather than what it should do, scope an architecture review.