pqTLS ========== Overview ---------------------- pqTLS is a TLS gateway part of QKDLite: it secures traffic between your clients and services, configured entirely from Helm values. * **Flexible TLS**: add, remove or replace TLS on either side of a connection. * **Post-quantum ready**: modern key exchange by default, with policies for stricter or older peers. * **One-way/Two-way TLS**: verify clients and authenticate to upstreams with certificates. * **TCP and HTTP**: proxy any TCP protocol or HTTP traffic. * **Hot reload**: config and certificate changes apply without restarts. How it works ---------------------- Each route is a listener (``listen.port``) plus an upstream. The route's ``ssl`` mode decides whether each leg is TLS: .. code-block:: text client ═══ TLS? ═══▶ :port gateway ═══ TLS? ═══▶ upstream listen.tls upstream.tls (terminate) (originate) 1. **Connect.** The client connects to ``listen.port``. 2. **Client-side TLS.** (optional) With ``listen.tls`` the gateway completes the handshake and presents its certificate. With ``client_validation`` the client must present a certificate signed by the configured CA and not revoked (mTLS). 3. **Pick the destination.** The route's ``upstream.address`` (``host:port``). 4. **Upstream TLS** (optional). With ``upstream.tls`` the gateway opens TLS to the upstream. SNI and certificate verification use ``hostname``, or else the upstream host. It can also present a client certificate (mTLS). 5. **Relay.** ``tcp`` routes copy bytes for the life of the connection, and ``http`` routes forward each request and stream the response. Specifications ---------------------- pqTLS supports: - **TLS versions:** - TLS 1.3 - TLS 1.2, TLS 1.1, TLS 1.0 - **TLS authentication** (incoming and outgoing connections): - One-way TLS: the server presents a certificate - Two-way TLS (mTLS): the client also presents a certificate - **Application protocols:** - Any protocol that starts with TLS (implicit TLS), such as HTTPS, gRPC, WebSocket, IMAPS, SMTPS, LDAPS, MQTT - **Key exchange:** - Post-quantum: ML-KEM - Hybrid: ML-KEM with X25519 or NIST curves - Classical: ECDHE and FFDHE - **Certificates:** - Post-quantum: ML-DSA - Classical: RSA, ECDSA, EdDSA The full lists are below, with the identifier used in configuration. .. dropdown:: TLS versions .. list-table:: :header-rows: 1 :widths: 40 30 :width: 100% * - Name - Support * - TLS 1.3 - Supported * - TLS 1.2 - Supported * - TLS 1.1 - Supported * - TLS 1.0 - Supported .. dropdown:: Application protocols pqTLS supports every application protocol that uses implicit TLS (SSL/TLS from the start) The groups below list common examples. .. dropdown:: Web .. list-table:: :header-rows: 1 :widths: 34 14 52 :width: 100% * - Protocol - Port - Route * - HTTPS (HTTP/1.1) - 443 - ``protocol: http`` * - HTTPS (HTTP/2) - 443 - ``protocol: http2`` * - WebSocket (wss) - 443 - ``protocol: http`` * - gRPC - any - ``protocol: grpc`` .. dropdown:: Mail .. list-table:: :header-rows: 1 :widths: 34 14 52 :width: 100% * - Protocol - Port - Route * - IMAPS - 993 - ``protocol: tcp`` * - POP3S - 995 - ``protocol: tcp`` * - SMTPS (submission) - 465 - ``protocol: tcp`` .. dropdown:: Directory and messaging .. list-table:: :header-rows: 1 :widths: 34 14 52 :width: 100% * - Protocol - Port - Route * - LDAPS - 636 - ``protocol: tcp`` * - MQTT over TLS - 8883 - ``protocol: tcp`` * - AMQP over TLS - 5671 - ``protocol: tcp`` .. dropdown:: Network services .. list-table:: :header-rows: 1 :widths: 34 14 52 :width: 100% * - Protocol - Port - Route * - DNS over TLS - 853 - ``protocol: tcp`` * - Syslog over TLS - 6514 - ``protocol: tcp`` .. dropdown:: Industrial .. list-table:: :header-rows: 1 :widths: 34 14 52 :width: 100% * - Protocol - Port - Route * - IEC 60870-5-104 over TLS - 19998 - ``protocol: tcp`` .. dropdown:: Key Exchange .. dropdown:: TLS 1.3 .. dropdown:: PQC Standards: `FIPS 203 `__, `draft-ietf-tls-mlkem `__ .. list-table:: :header-rows: 1 :widths: 55 45 :width: 100% * - Name - Identifier * - ML-KEM-512 - ``MLKEM512`` * - ML-KEM-768 - ``MLKEM768`` * - ML-KEM-1024 - ``MLKEM1024`` .. dropdown:: Hybrid PQC Standards: `RFC 10024 `__, `RFC 9954 `__, `FIPS 203 `__ .. list-table:: :header-rows: 1 :widths: 55 45 :width: 100% * - Name - Identifier * - ECDH P-256 + ML-KEM-768 - ``SecP256r1MLKEM768`` * - X25519 + ML-KEM-768 - ``X25519MLKEM768`` * - ECDH P-384 + ML-KEM-1024 - ``SecP384r1MLKEM1024`` .. dropdown:: Classical Standards: `RFC 9846 `__, `RFC 7748 `__, `NIST SP 800-186 `__, `RFC 8734 `__, `RFC 7919 `__ .. list-table:: :header-rows: 1 :widths: 55 45 :width: 100% * - Name - Identifier * - X25519 - ``x25519`` * - X448 - ``x448`` * - NIST P-256 - ``secp256r1`` * - NIST P-384 - ``secp384r1`` * - NIST P-521 - ``secp521r1`` * - Brainpool P-256r1 - ``brainpoolP256r1tls13`` * - Brainpool P-384r1 - ``brainpoolP384r1tls13`` * - Brainpool P-512r1 - ``brainpoolP512r1tls13`` * - FFDHE 2048-bit - ``ffdhe2048`` * - FFDHE 3072-bit - ``ffdhe3072`` * - FFDHE 4096-bit - ``ffdhe4096`` * - FFDHE 6144-bit - ``ffdhe6144`` * - FFDHE 8192-bit - ``ffdhe8192`` .. dropdown:: TLS 1.2 and earlier Standards: `RFC 8422 `__, `RFC 7748 `__, `NIST SP 800-186 `__, `SEC 2 `__, `RFC 5639 `__, `RFC 7027 `__ .. list-table:: :header-rows: 1 :widths: 55 45 :width: 100% * - Name - Identifier * - X25519 - ``x25519`` * - X448 - ``x448`` * - NIST P-256 - ``secp256r1`` * - NIST P-384 - ``secp384r1`` * - NIST P-521 - ``secp521r1`` * - NIST K-163 - ``sect163k1`` * - SEC 2 sect163r1 - ``sect163r1`` * - NIST B-163 - ``sect163r2`` * - SEC 2 sect193r1 - ``sect193r1`` * - SEC 2 sect193r2 - ``sect193r2`` * - NIST K-233 - ``sect233k1`` * - NIST B-233 - ``sect233r1`` * - SEC 2 sect239k1 - ``sect239k1`` * - NIST K-283 - ``sect283k1`` * - NIST B-283 - ``sect283r1`` * - NIST K-409 - ``sect409k1`` * - NIST B-409 - ``sect409r1`` * - NIST K-571 - ``sect571k1`` * - NIST B-571 - ``sect571r1`` * - SEC 2 secp160k1 - ``secp160k1`` * - SEC 2 secp160r1 - ``secp160r1`` * - SEC 2 secp160r2 - ``secp160r2`` * - SEC 2 secp192k1 - ``secp192k1`` * - NIST P-192 - ``secp192r1`` * - SEC 2 secp224k1 - ``secp224k1`` * - NIST P-224 - ``secp224r1`` * - SEC 2 secp256k1 - ``secp256k1`` * - Brainpool P-256r1 - ``brainpoolP256r1`` * - Brainpool P-384r1 - ``brainpoolP384r1`` * - Brainpool P-512r1 - ``brainpoolP512r1`` .. dropdown:: Signature schemes .. dropdown:: TLS 1.3 .. dropdown:: PQC Standards: `FIPS 204 `__, `draft-ietf-tls-mldsa `__, `RFC 9881 `__ .. list-table:: :header-rows: 1 :widths: 55 45 :width: 100% * - Name - Identifier * - ML-DSA-44 - ``mldsa44`` * - ML-DSA-65 - ``mldsa65`` * - ML-DSA-87 - ``mldsa87`` .. dropdown:: Classical Standards: `RFC 9846 `__, `FIPS 186-5 `__, `RFC 8032 `__, `RFC 8017 `__, `RFC 8734 `__, `FIPS 180-4 `__ .. list-table:: :header-rows: 1 :widths: 55 45 :width: 100% * - Name - Identifier * - ECDSA NIST P-256 with SHA-256 - ``ecdsa_secp256r1_sha256`` * - ECDSA NIST P-384 with SHA-384 - ``ecdsa_secp384r1_sha384`` * - ECDSA NIST P-521 with SHA-512 - ``ecdsa_secp521r1_sha512`` * - Ed25519 - ``ed25519`` * - Ed448 - ``ed448`` * - ECDSA Brainpool P-256r1 with SHA-256 - ``ecdsa_brainpoolP256r1tls13_sha256`` * - ECDSA Brainpool P-384r1 with SHA-384 - ``ecdsa_brainpoolP384r1tls13_sha384`` * - ECDSA Brainpool P-512r1 with SHA-512 - ``ecdsa_brainpoolP512r1tls13_sha512`` * - RSASSA-PSS with SHA-256 (RSA key) - ``rsa_pss_rsae_sha256`` * - RSASSA-PSS with SHA-384 (RSA key) - ``rsa_pss_rsae_sha384`` * - RSASSA-PSS with SHA-512 (RSA key) - ``rsa_pss_rsae_sha512`` * - RSASSA-PSS with SHA-256 (RSA-PSS key) - ``rsa_pss_pss_sha256`` * - RSASSA-PSS with SHA-384 (RSA-PSS key) - ``rsa_pss_pss_sha384`` * - RSASSA-PSS with SHA-512 (RSA-PSS key) - ``rsa_pss_pss_sha512`` .. dropdown:: TLS 1.2 and earlier Standards: `RFC 5246 `__, `RFC 8422 `__, `RFC 9846 `__, `FIPS 186-5 `__, `RFC 8032 `__, `RFC 8017 `__, `FIPS 180-4 `__ .. list-table:: :header-rows: 1 :widths: 55 45 :width: 100% * - Name - Identifier * - ECDSA with SHA-256 - ``ecdsa_secp256r1_sha256`` * - ECDSA with SHA-384 - ``ecdsa_secp384r1_sha384`` * - ECDSA with SHA-512 - ``ecdsa_secp521r1_sha512`` * - Ed25519 - ``ed25519`` * - Ed448 - ``ed448`` * - RSASSA-PSS with SHA-256 (RSA key) - ``rsa_pss_rsae_sha256`` * - RSASSA-PSS with SHA-384 (RSA key) - ``rsa_pss_rsae_sha384`` * - RSASSA-PSS with SHA-512 (RSA key) - ``rsa_pss_rsae_sha512`` * - RSASSA-PSS with SHA-256 (RSA-PSS key) - ``rsa_pss_pss_sha256`` * - RSASSA-PSS with SHA-384 (RSA-PSS key) - ``rsa_pss_pss_sha384`` * - RSASSA-PSS with SHA-512 (RSA-PSS key) - ``rsa_pss_pss_sha512`` * - RSASSA-PKCS1-v1_5 with SHA-256 - ``rsa_pkcs1_sha256`` * - RSASSA-PKCS1-v1_5 with SHA-384 - ``rsa_pkcs1_sha384`` * - RSASSA-PKCS1-v1_5 with SHA-512 - ``rsa_pkcs1_sha512`` * - ECDSA with SHA-224 - ``ecdsa_sha224`` * - ECDSA with SHA-1 - ``ecdsa_sha1`` * - RSASSA-PKCS1-v1_5 with SHA-224 - ``rsa_pkcs1_sha224`` * - RSASSA-PKCS1-v1_5 with SHA-1 - ``rsa_pkcs1_sha1`` .. dropdown:: Cipher suites .. dropdown:: TLS 1.3 TLS 1.3 cipher suites set the symmetric encryption only; key exchange and signatures are negotiated separately (lists above). .. dropdown:: Classical Standards: `RFC 9846 `__, `FIPS 197 `__, `NIST SP 800-38D `__, `NIST SP 800-38C `__, `RFC 8439 `__ .. list-table:: :header-rows: 1 :widths: 55 45 :width: 100% * - Name - Identifier * - AES-256-GCM with SHA-384 - ``TLS_AES_256_GCM_SHA384`` * - ChaCha20-Poly1305 with SHA-256 - ``TLS_CHACHA20_POLY1305_SHA256`` * - AES-128-GCM with SHA-256 - ``TLS_AES_128_GCM_SHA256`` * - AES-128-CCM with SHA-256 - ``TLS_AES_128_CCM_SHA256`` * - AES-128-CCM (8-byte tag) with SHA-256 - ``TLS_AES_128_CCM_8_SHA256`` .. dropdown:: TLS 1.2 and earlier Standards: `RFC 5246 `__, `RFC 8422 `__, `RFC 5288 `__, `RFC 5289 `__, `RFC 6655 `__, `RFC 7251 `__, `RFC 7905 `__, `RFC 6209 `__, `RFC 5932 `__, `RFC 6367 `__, `RFC 10015 `__, `FIPS 197 `__, `NIST SP 800-38D `__, `NIST SP 800-38C `__, `RFC 8439 `__, `RFC 3713 `__, `RFC 5794 `__, `FIPS 198-1 `__ .. list-table:: :header-rows: 1 :widths: 55 45 :width: 100% * - Name (IANA) - Identifier * - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 - ``ECDHE-ECDSA-AES256-GCM-SHA384`` * - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 - ``ECDHE-RSA-AES256-GCM-SHA384`` * - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 - ``ECDHE-ECDSA-CHACHA20-POLY1305`` * - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 - ``ECDHE-RSA-CHACHA20-POLY1305`` * - TLS_ECDHE_ECDSA_WITH_AES_256_CCM - ``ECDHE-ECDSA-AES256-CCM`` * - TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 - ``ECDHE-ECDSA-ARIA256-GCM-SHA384`` * - TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384 - ``ECDHE-ARIA256-GCM-SHA384`` * - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 - ``ECDHE-ECDSA-AES128-GCM-SHA256`` * - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - ``ECDHE-RSA-AES128-GCM-SHA256`` * - TLS_ECDHE_ECDSA_WITH_AES_128_CCM - ``ECDHE-ECDSA-AES128-CCM`` * - TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 - ``ECDHE-ECDSA-ARIA128-GCM-SHA256`` * - TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256 - ``ECDHE-ARIA128-GCM-SHA256`` * - TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 - ``ECDHE-ECDSA-AES256-CCM8`` * - TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 - ``ECDHE-ECDSA-AES128-CCM8`` * - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 - ``ECDHE-ECDSA-AES256-SHA384`` * - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 - ``ECDHE-RSA-AES256-SHA384`` * - TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - ``ECDHE-ECDSA-CAMELLIA256-SHA384`` * - TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 - ``ECDHE-RSA-CAMELLIA256-SHA384`` * - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 - ``ECDHE-ECDSA-AES128-SHA256`` * - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - ``ECDHE-RSA-AES128-SHA256`` * - TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - ``ECDHE-ECDSA-CAMELLIA128-SHA256`` * - TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - ``ECDHE-RSA-CAMELLIA128-SHA256`` * - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA - ``ECDHE-ECDSA-AES256-SHA`` * - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - ``ECDHE-RSA-AES256-SHA`` * - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA - ``ECDHE-ECDSA-AES128-SHA`` * - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - ``ECDHE-RSA-AES128-SHA`` * - TLS_RSA_WITH_AES_256_GCM_SHA384 - ``AES256-GCM-SHA384`` * - TLS_RSA_WITH_AES_256_CCM - ``AES256-CCM`` * - TLS_RSA_WITH_ARIA_256_GCM_SHA384 - ``ARIA256-GCM-SHA384`` * - TLS_RSA_WITH_AES_128_GCM_SHA256 - ``AES128-GCM-SHA256`` * - TLS_RSA_WITH_AES_128_CCM - ``AES128-CCM`` * - TLS_RSA_WITH_ARIA_128_GCM_SHA256 - ``ARIA128-GCM-SHA256`` * - TLS_RSA_WITH_AES_256_CCM_8 - ``AES256-CCM8`` * - TLS_RSA_WITH_AES_128_CCM_8 - ``AES128-CCM8`` * - TLS_RSA_WITH_AES_256_CBC_SHA256 - ``AES256-SHA256`` * - TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 - ``CAMELLIA256-SHA256`` * - TLS_RSA_WITH_AES_128_CBC_SHA256 - ``AES128-SHA256`` * - TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 - ``CAMELLIA128-SHA256`` * - TLS_RSA_WITH_AES_256_CBC_SHA - ``AES256-SHA`` * - TLS_RSA_WITH_CAMELLIA_256_CBC_SHA - ``CAMELLIA256-SHA`` * - TLS_RSA_WITH_AES_128_CBC_SHA - ``AES128-SHA`` * - TLS_RSA_WITH_CAMELLIA_128_CBC_SHA - ``CAMELLIA128-SHA`` .. dropdown:: Certificate key types .. dropdown:: TLS 1.3 .. dropdown:: PQC Standards: `FIPS 204 `__, `RFC 9881 `__, `RFC 5280 `__, `RFC 5958 `__ .. list-table:: :header-rows: 1 :widths: 55 45 :width: 100% * - Name - Identifier * - ML-DSA-44 - ``id-ml-dsa-44`` * - ML-DSA-65 - ``id-ml-dsa-65`` * - ML-DSA-87 - ``id-ml-dsa-87`` .. dropdown:: Classical Standards: `RFC 5280 `__, `RFC 5958 `__, `RFC 3279 `__, `RFC 8017 `__, `RFC 4055 `__, `RFC 5480 `__, `NIST SP 800-186 `__, `RFC 5639 `__, `RFC 8410 `__ .. list-table:: :header-rows: 1 :widths: 55 45 :width: 100% * - Name - Identifier * - RSA, 2048 bits and up - ``rsaEncryption`` * - RSA-PSS - ``id-RSASSA-PSS`` * - ECDSA NIST P-256 - ``id-ecPublicKey, prime256v1`` * - ECDSA NIST P-384 - ``id-ecPublicKey, secp384r1`` * - ECDSA NIST P-521 - ``id-ecPublicKey, secp521r1`` * - ECDSA Brainpool P-256r1 - ``id-ecPublicKey, brainpoolP256r1`` * - ECDSA Brainpool P-384r1 - ``id-ecPublicKey, brainpoolP384r1`` * - ECDSA Brainpool P-512r1 - ``id-ecPublicKey, brainpoolP512r1`` * - Ed25519 - ``id-Ed25519`` * - Ed448 - ``id-Ed448`` .. dropdown:: TLS 1.2 and earlier Standards: `RFC 5280 `__, `RFC 5958 `__, `RFC 3279 `__, `RFC 8017 `__, `RFC 4055 `__, `RFC 5480 `__, `NIST SP 800-186 `__, `RFC 5639 `__, `RFC 8410 `__ .. list-table:: :header-rows: 1 :widths: 55 45 :width: 100% * - Name - Identifier * - RSA, 2048 bits and up - ``rsaEncryption`` * - RSA-PSS - ``id-RSASSA-PSS`` * - ECDSA NIST P-256 - ``id-ecPublicKey, prime256v1`` * - ECDSA NIST P-384 - ``id-ecPublicKey, secp384r1`` * - ECDSA NIST P-521 - ``id-ecPublicKey, secp521r1`` * - ECDSA Brainpool P-256r1 - ``id-ecPublicKey, brainpoolP256r1`` * - ECDSA Brainpool P-384r1 - ``id-ecPublicKey, brainpoolP384r1`` * - ECDSA Brainpool P-512r1 - ``id-ecPublicKey, brainpoolP512r1`` * - Ed25519 - ``id-Ed25519`` * - Ed448 - ``id-Ed448`` Configuration ---------------------- Helm values for an egress proxy: internal clients send plain HTTP, and the gateway forwards to ``api.example.com`` over HTTPS with mTLS. TCP routes ^^^^^^^^^^^^^^^^^^^^^^^ The gateway relays the connection's bytes, whatever the protocol (database, MQTT, gRPC, custom). The destination is fixed per route. Certificates used by the examples below: .. code-block:: yaml pqtls: certDirs: example-client: { secretName: example-tls } # our client cert + key (to the partner) gateway-server: { secretName: gateway-tls } # cert + key the gateway presents to clients clients-ca: { secretName: clients-ca } # ca.crt that signs client certs gateway: certs: to-partner: # upstream side client_certificate: example-client from-clients: # listen side certificate: gateway-server client_validation: { ca: clients-ca } # optional: require client certs (mTLS) plain → TLS """"""""""" Plain clients; the gateway adds TLS and its client certificate towards the partner (``originate``). .. code-block:: yaml pqtls: gateway: routes: - name: egress ssl: originate # TCP in, TLS out listen: port: 3128 # protocol: tcp (default) upstream: address: "api.example.com:443" tls: { certs: to-partner } # SNI + cert check: api.example.com TLS → TLS """"""""" Clients connect over (m)TLS to the gateway; the gateway decrypts and opens its own TLS to the partner (``reencrypt``). Each side has its own certificates and policy. .. code-block:: yaml pqtls: gateway: routes: - name: relay ssl: reencrypt # TLS in, TLS out listen: port: 8443 tls: { certs: from-clients } upstream: address: "api.example.com:443" tls: { certs: to-partner } TLS → plain """"""""""" Clients connect over (m)TLS; the gateway decrypts and forwards plain TCP to an internal service (``terminate``). .. code-block:: yaml pqtls: gateway: routes: - name: ingress ssl: terminate # TLS in, TCP out listen: port: 9443 tls: { certs: from-clients } upstream: address: "app.{{ .Release.Namespace }}.svc.cluster.local:5432" HTTP routes ^^^^^^^^^^^^^^^^^^^^^^^ Same three directions with ``listen.protocol: http``: the gateway handles HTTP requests (per-request logs, HTTP status codes). It sets the upstream ``Host`` to the upstream address's host. The certificates are the same as above. plain → TLS """"""""""" .. code-block:: yaml pqtls: gateway: routes: - name: egress ssl: originate # HTTP in, HTTPS out listen: port: 3128 protocol: http upstream: address: "api.example.com:443" tls: { certs: to-partner } TLS → TLS """"""""" .. code-block:: yaml pqtls: gateway: routes: - name: relay ssl: reencrypt # HTTPS in, HTTPS out listen: port: 8443 protocol: http tls: { certs: from-clients } upstream: address: "api.example.com:443" tls: { certs: to-partner } TLS → plain """"""""""" .. code-block:: yaml pqtls: gateway: routes: - name: ingress ssl: terminate # HTTPS in, HTTP out listen: port: 9443 protocol: http tls: { certs: from-clients } upstream: address: "app.{{ .Release.Namespace }}.svc.cluster.local:8080" One-way TLS ^^^^^^^^^^^^^^^^^^^^^^^^^^ Only the server proves its identity: the gateway presents a certificate to clients, and checks the certificate of the upstream. .. code-block:: yaml pqtls: certDirs: gateway-server: { secretName: gateway-tls } # tls.crt + tls.key the gateway presents to clients partner-ca: { secretName: partner-ca } # ca.crt that signs the upstream's cert Clients → pqTLS """""""""""""""""""""" .. code-block:: yaml pqtls: gateway: certs: from-clients: certificate: gateway-server pqTLS → upstream """""""""""""""""""""" .. code-block:: yaml pqtls: gateway: certs: to-partner: validation: { ca: partner-ca } # omit ca to trust the system CA bundle The upstream certificate is checked against the host in ``upstream.address``. Set ``upstream.tls.hostname`` when they differ, e.g. when the address is an IP. Use the profiles in a route """"""""""""""""""""""""""" .. code-block:: yaml pqtls: gateway: routes: - name: partner ssl: reencrypt listen: port: 8443 tls: { certs: from-clients } upstream: address: "api.example.com:443" tls: { certs: to-partner } Two-way TLS (mTLS) ^^^^^^^^^^^^^^^^^^^^^^^^^^ Both sides present a certificate: the gateway also requires a client certificate from clients, and presents its own client certificate to the upstream. Each side builds on its one-way profile. .. code-block:: yaml pqtls: certDirs: gateway-server: { secretName: gateway-tls } # tls.crt + tls.key the gateway presents to clients clients-ca: { secretName: clients-ca } # ca.crt that signs client certs partner-ca: { secretName: partner-ca } # ca.crt that signs the upstream's cert example-client: { secretName: example-tls } # tls.crt + tls.key the gateway presents upstream Clients → pqTLS """""""""""""""""""""" .. code-block:: yaml pqtls: gateway: certs: from-clients-mtls: certificate: gateway-server client_validation: ca: clients-ca # client certs must chain to clients-ca/ca.crt mode: required # optional: accept clients without a cert depth: 2 # max chain length (default 2) pqTLS → upstream """""""""""""""""""""" .. code-block:: yaml pqtls: gateway: certs: to-partner-mtls: validation: { ca: partner-ca } client_certificate: example-client Use the profiles in a route """"""""""""""""""""""""""" .. code-block:: yaml pqtls: gateway: routes: - name: partner ssl: reencrypt listen: port: 8443 tls: { certs: from-clients-mtls } upstream: address: "api.example.com:443" tls: { certs: to-partner-mtls } Exposing pqTLS ---------------------- LoadBalancer ^^^^^^^^^^^^^^^^^^^^^^^^ The chart creates a Service with one port per route, named ``-`` (``http-3128``, ``tcp-9443``). By default it is ``ClusterIP``: reachable inside the cluster at ``-qkdlite-pqtls.:``. To reach it from outside the cluster, use a ``LoadBalancer``: .. code-block:: yaml service: type: LoadBalancer annotations: # cloud-specific, e.g. AKS internal LB service.beta.kubernetes.io/azure-load-balancer-internal: "true" ports: http-3128: 8080 # expose route port 3128 as 8080 Ingress ^^^^^^^^^^^^^^^^^^^^^^^^^^^ The Ingress API itself only describes HTTP routing by host and path. It has no notion of TLS passthrough or raw TCP, so every controller adds these in its own way (annotations, controller flags, ConfigMaps or its own CRDs). In your controller's documentation, look for these two features: * **TLS / SSL passthrough**: routes by SNI on the shared HTTPS port and forwards the encrypted bytes untouched. Use this for routes with ``listen.tls``. * **TCP services**: a dedicated controller port forwarded to a Service port. Use this for plain routes (``originate``, ``off``, the forward proxy). Whatever the vendor, point it at the gateway Service: .. list-table:: :header-rows: 1 :widths: 34 33 33 * - Gateway route - Controller feature - Backend * - ``listen.tls`` (``terminate`` / ``reencrypt``) - TLS passthrough, host = a name in the gateway cert - ``-gateway:`` * - plain TCP (``originate`` / ``off``) - TCP service on its own port - ``-gateway:`` * - ``http``, fixed upstream, no ``listen.tls`` - a standard Ingress rule (host + path), no extras - ``-gateway:`` Examples of the vendor-specific part: .. list-table:: :header-rows: 1 :widths: 22 39 39 * - Controller - TLS passthrough - TCP * - Traefik - ``IngressRouteTCP`` with ``HostSNI(`name`)`` and ``tls.passthrough: true`` - ``IngressRouteTCP`` on its own entryPoint, ``HostSNI(`*`)`` * - Contour - ``HTTPProxy`` with ``virtualhost.tls.passthrough: true`` and ``tcpproxy`` - not supported (use Gateway API ``TCPRoute``) * - ingress-nginx (retired March 2026) - annotation ``nginx.ingress.kubernetes.io/ssl-passthrough: "true"``, controller flag ``--enable-ssl-passthrough`` - ``tcp-services`` ConfigMap The controller must never terminate TLS for these routes: it would replace the gateway's certificate, and client certificates (mTLS) would not reach the gateway. Gateway API ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Gateway API is the same across vendors. Only ``gatewayClassName`` changes, plus whether the implementation supports the route kinds you need (check its conformance report for ``TLSRoute`` and ``TCPRoute``). A shared ``Gateway`` gets one listener per kind of traffic, and each gateway route gets a route object pointing at the gateway Service: .. list-table:: :header-rows: 1 :widths: 34 33 33 * - Gateway route - Listener - Route object * - ``listen.tls`` (``terminate`` / ``reencrypt``) - ``protocol: TLS``, ``tls.mode: Passthrough`` - ``TLSRoute`` (by hostname) * - plain TCP (``originate`` / ``off``) - ``protocol: TCP``, own port - ``TCPRoute`` * - ``http``, fixed upstream, no ``listen.tls`` - ``protocol: HTTP`` - ``HTTPRoute`` .. code-block:: yaml apiVersion: gateway.networking.k8s.io/v1 kind: Gateway metadata: { name: shared, namespace: infra } spec: gatewayClassName: # the only vendor-specific line listeners: - name: tls-passthrough protocol: TLS port: 443 hostname: "*.gw.example.com" tls: { mode: Passthrough } # no certificateRefs: the gateway pod does TLS allowedRoutes: { namespaces: { from: All }, kinds: [{ kind: TLSRoute }] } - name: egress-proxy protocol: TCP port: 3128 allowedRoutes: { namespaces: { from: All }, kinds: [{ kind: TCPRoute }] } --- apiVersion: gateway.networking.k8s.io/v1 kind: TLSRoute metadata: { name: edge-web, namespace: shop } spec: parentRefs: [{ name: shared, namespace: infra, sectionName: tls-passthrough }] hostnames: [web.gw.example.com] # must be in the gateway cert's SANs rules: - backendRefs: [{ name: -qkdlite-pqtls, port: 8443 }] --- apiVersion: gateway.networking.k8s.io/v1 kind: TCPRoute metadata: { name: edge-egress, namespace: shop } spec: parentRefs: [{ name: shared, namespace: infra, sectionName: egress-proxy }] rules: - backendRefs: [{ name: -qkdlite-pqtls, port: 3128 }] ``TLSRoute`` is ``v1`` since Gateway API v1.5, and ``TCPRoute`` since v1.6. On older CRDs, use ``v1alpha2`` from the Experimental channel. .. note:: For both Ingress and Gateway API: * Keep the gateway Service ``ClusterIP`` (the chart default); the front proxy is the entry point. Backend ports are the Service ports, after any ``service.ports`` remap. * TLS passthrough needs SNI: clients must connect by hostname, and that name must be in the gateway's certificate. * The front proxy opens its own connection to the gateway, so ``listen.allow`` sees the proxy's pod IP, not the client's. Restrict clients at the front proxy, and allow the proxy's pod CIDR (or nothing) in ``listen.allow``. * The forward proxy (``{host}``) can only be exposed as TCP. Its ``Host`` is the destination, not the gateway's name, so host-based HTTP rules never match it. Security Configuration ------------------------- Each TLS side of a route uses a policy: TLS versions, ciphers and key exchange groups. Three policies are built in: .. list-table:: :header-rows: 1 :widths: 15 85 * - Policy - Use for * - ``default`` - TLS 1.2 and 1.3 with modern ciphers. Prefers post-quantum key exchange, falls back to classical. Used when a route sets no ``crypto``. * - ``pq`` - TLS 1.3 with post-quantum key exchange only. Clients without it are refused. * - ``legacy`` - Old clients or servers that need TLS 1.0 / 1.1 or older ciphers. Pick a policy per route side: .. code-block:: yaml pqtls: gateway: routes: - name: relay ssl: reencrypt listen: port: 8443 tls: { certs: from-clients, crypto: pq } # clients must use post-quantum upstream: address: "old-partner.example.com:443" tls: { certs: to-partner, crypto: legacy } # partner only speaks TLS 1.0 Change the default for every route that sets no ``crypto``: .. code-block:: yaml pqtls: gateway: crypto: default: pq Define your own policy, or redefine a built-in (a name you define replaces the built-in completely): .. code-block:: yaml pqtls: gateway: crypto: strict: protocols: [TLSv1.3] ciphersuites: [TLS_AES_256_GCM_SHA384, TLS_CHACHA20_POLY1305_SHA256] groups: [X25519MLKEM768, X25519] # also: ciphers (TLS 1.2), prefer_server_ciphers (listen side) .. Extras .. ---------------------- .. Dynamic destinations .. ^^^^^^^^^^^^^^^^^^^^^^^^ .. Instead of a fixed ``host:port``, ``upstream.address`` can take the .. destination from the traffic, limited by an allow-list: .. * ``{sni}`` with ``listen.sni_allow`` (``tcp`` routes): the SNI of the .. client's own TLS, read without decrypting it. With ``off`` it is passed .. through to that destination. With ``originate`` it is wrapped in the .. gateway's TLS, and with ``terminate`` / ``reencrypt`` it is the TLS carried .. inside the connection the gateway terminates (edge → peer tunnel). .. * ``{host}`` with ``listen.host_allow`` (``http`` routes): the request's .. ``Host``. Works in every ``ssl`` mode.