Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

TLS

Meridian terminates TLS on downstream connections using rustls, a pure-Rust TLS implementation. Upstream connections to backends remain plain HTTP.

Configuration

Add a tls section to any listener:

[[listeners]]
name = "https"
address = "0.0.0.0:8443"
filter_chain = []

[listeners.tls]
cert_path = "/etc/meridian/server.crt"
key_path = "/etc/meridian/server.key"

Fields

FieldTypeRequiredDescription
cert_pathstringyesPath to PEM-encoded certificate chain
key_pathstringyesPath to PEM-encoded private key

Certificate Format

Certificates and keys must be PEM-encoded. The certificate file should contain the full chain (leaf certificate first, then intermediates):

-----BEGIN CERTIFICATE-----
(leaf certificate)
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
(intermediate CA)
-----END CERTIFICATE-----

Protocol Support

  • TLS 1.2 and 1.3 — both supported, with safe defaults
  • ALPN negotiation — advertises h2 and http/1.1
  • HTTP/2 over TLS — clients that negotiate h2 via ALPN are handled by the HTTP/2 connection handler automatically

Why rustls?

PropertyrustlsOpenSSL/BoringSSL
Memory safetyFull Rust guaranteesC code, requires unsafe FFI
PerformanceWithin 5-10% of BoringSSLSlightly faster RSA
DependencyPure Rust, ~50KBC library, ~2MB, cmake
Audit historyCure53 audit (2020)Multiple audits

rustls eliminates entire classes of TLS implementation vulnerabilities (buffer overflows, use-after-free) that have produced CVEs in C-based TLS libraries.