TLS Passthrough#

TLS Passthrough lets Caddy forward encrypted TLS connections directly to an upstream without terminating (decrypting) them. The upstream handles TLS itself — Caddy never sees the plaintext.

When to use it#

Use TLS Passthrough when:

  • The upstream requires mutual TLS (mTLS) / client certificates that Caddy cannot forward
  • The upstream is a database or other service presenting its own TLS certificate
  • You need end-to-end encryption between client and upstream with no proxy in the middle
  • The upstream uses a private CA certificate that Caddy cannot validate
  • The upstream must see the original client handshake, such as some IIS Extended Protection setups. Leave NTLM authentication passthrough off. That control is legacy, and its IIS behavior is not verified.

How to enable#

On the Details tab, toggle TLS Passthrough on. When enabled:

  • PosternProxy uses Caddy’s Layer 4 (caddy-l4) module instead of the HTTP server
  • The stream is matched by SNI hostname (the domain name in the TLS ClientHello)
  • Traffic is forwarded as raw TCP bytes — no HTTP inspection, headers, or access lists
  • The upstream port must accept TLS connections
Security tab with TLS Passthrough enabled and its warning visible

Unsaved passthrough example. TLS termination remains the upstream application’s responsibility.

Limitations#

NTLM authentication passthrough cannot be combined with TLS passthrough. Saving a host with both enabled is rejected.

Because TLS Passthrough bypasses Caddy’s HTTP layer, the following features are not available when passthrough is enabled:

FeatureAvailable?
Automatic Let’s Encrypt✗ (upstream provides its own cert)
HSTS / Force HTTPS✗
Access lists (IP rules)✗ (client IP is still visible at L4)
Rate limiting✗
Custom headers✗
Custom error pages✗
WebSocket support✓ (transparent)

SNI matching#

Caddy uses the SNI field of the TLS ClientHello to match the stream to the correct proxy host. The client must send SNI — most modern clients do automatically.

Clients that do not send matching SNI cannot select that passthrough route. They fall through to the configured HTTPS fallback; handshake and routing behavior then depend on that fallback configuration.

Layer 4 plugin#

TLS Passthrough requires the github.com/mholt/caddy-l4 plugin. This is included in the Caddy binary installed by posternproxy install — no additional steps are needed.

PosternProxyQuick start →