7.2. pqTLS¶
7.2.1. 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.
7.2.2. How it works¶
Each route is a listener (listen.port) plus an upstream. The route’s
ssl mode decides whether each leg is TLS:
client ═══ TLS? ═══▶ :port gateway ═══ TLS? ═══▶ upstream
listen.tls upstream.tls
(terminate) (originate)
Connect. The client connects to
listen.port.Client-side TLS. (optional) With
listen.tlsthe gateway completes the handshake and presents its certificate. Withclient_validationthe client must present a certificate signed by the configured CA and not revoked (mTLS).Pick the destination. The route’s
upstream.address(host:port).Upstream TLS (optional). With
upstream.tlsthe gateway opens TLS to the upstream. SNI and certificate verification usehostname, or else the upstream host. It can also present a client certificate (mTLS).Relay.
tcproutes copy bytes for the life of the connection, andhttproutes forward each request and stream the response.
7.2.3. 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.
TLS versions
Name |
Support |
|---|---|
TLS 1.3 |
Supported |
TLS 1.2 |
Supported |
TLS 1.1 |
Supported |
TLS 1.0 |
Supported |
Application protocols
pqTLS supports every application protocol that uses implicit TLS (SSL/TLS from the start) The groups below list common examples.
Web
Protocol |
Port |
Route |
|---|---|---|
HTTPS (HTTP/1.1) |
443 |
|
HTTPS (HTTP/2) |
443 |
|
WebSocket (wss) |
443 |
|
gRPC |
any |
|
Protocol |
Port |
Route |
|---|---|---|
IMAPS |
993 |
|
POP3S |
995 |
|
SMTPS (submission) |
465 |
|
Directory and messaging
Protocol |
Port |
Route |
|---|---|---|
LDAPS |
636 |
|
MQTT over TLS |
8883 |
|
AMQP over TLS |
5671 |
|
Network services
Protocol |
Port |
Route |
|---|---|---|
DNS over TLS |
853 |
|
Syslog over TLS |
6514 |
|
Industrial
Protocol |
Port |
Route |
|---|---|---|
IEC 60870-5-104 over TLS |
19998 |
|
Key Exchange
TLS 1.3
PQC
Standards: FIPS 203, draft-ietf-tls-mlkem
Name |
Identifier |
|---|---|
ML-KEM-512 |
|
ML-KEM-768 |
|
ML-KEM-1024 |
|
Hybrid PQC
Classical
Standards: RFC 9846, RFC 7748, NIST SP 800-186, RFC 8734, RFC 7919
Name |
Identifier |
|---|---|
X25519 |
|
X448 |
|
NIST P-256 |
|
NIST P-384 |
|
NIST P-521 |
|
Brainpool P-256r1 |
|
Brainpool P-384r1 |
|
Brainpool P-512r1 |
|
FFDHE 2048-bit |
|
FFDHE 3072-bit |
|
FFDHE 4096-bit |
|
FFDHE 6144-bit |
|
FFDHE 8192-bit |
|
TLS 1.2 and earlier
Standards: RFC 8422, RFC 7748, NIST SP 800-186, SEC 2, RFC 5639, RFC 7027
Name |
Identifier |
|---|---|
X25519 |
|
X448 |
|
NIST P-256 |
|
NIST P-384 |
|
NIST P-521 |
|
NIST K-163 |
|
SEC 2 sect163r1 |
|
NIST B-163 |
|
SEC 2 sect193r1 |
|
SEC 2 sect193r2 |
|
NIST K-233 |
|
NIST B-233 |
|
SEC 2 sect239k1 |
|
NIST K-283 |
|
NIST B-283 |
|
NIST K-409 |
|
NIST B-409 |
|
NIST K-571 |
|
NIST B-571 |
|
SEC 2 secp160k1 |
|
SEC 2 secp160r1 |
|
SEC 2 secp160r2 |
|
SEC 2 secp192k1 |
|
NIST P-192 |
|
SEC 2 secp224k1 |
|
NIST P-224 |
|
SEC 2 secp256k1 |
|
Brainpool P-256r1 |
|
Brainpool P-384r1 |
|
Brainpool P-512r1 |
|
Signature schemes
TLS 1.3
PQC
Standards: FIPS 204, draft-ietf-tls-mldsa, RFC 9881
Name |
Identifier |
|---|---|
ML-DSA-44 |
|
ML-DSA-65 |
|
ML-DSA-87 |
|
Classical
Standards: RFC 9846, FIPS 186-5, RFC 8032, RFC 8017, RFC 8734, FIPS 180-4
Name |
Identifier |
|---|---|
ECDSA NIST P-256 with SHA-256 |
|
ECDSA NIST P-384 with SHA-384 |
|
ECDSA NIST P-521 with SHA-512 |
|
Ed25519 |
|
Ed448 |
|
ECDSA Brainpool P-256r1 with SHA-256 |
|
ECDSA Brainpool P-384r1 with SHA-384 |
|
ECDSA Brainpool P-512r1 with SHA-512 |
|
RSASSA-PSS with SHA-256 (RSA key) |
|
RSASSA-PSS with SHA-384 (RSA key) |
|
RSASSA-PSS with SHA-512 (RSA key) |
|
RSASSA-PSS with SHA-256 (RSA-PSS key) |
|
RSASSA-PSS with SHA-384 (RSA-PSS key) |
|
RSASSA-PSS with SHA-512 (RSA-PSS key) |
|
TLS 1.2 and earlier
Standards: RFC 5246, RFC 8422, RFC 9846, FIPS 186-5, RFC 8032, RFC 8017, FIPS 180-4
Name |
Identifier |
|---|---|
ECDSA with SHA-256 |
|
ECDSA with SHA-384 |
|
ECDSA with SHA-512 |
|
Ed25519 |
|
Ed448 |
|
RSASSA-PSS with SHA-256 (RSA key) |
|
RSASSA-PSS with SHA-384 (RSA key) |
|
RSASSA-PSS with SHA-512 (RSA key) |
|
RSASSA-PSS with SHA-256 (RSA-PSS key) |
|
RSASSA-PSS with SHA-384 (RSA-PSS key) |
|
RSASSA-PSS with SHA-512 (RSA-PSS key) |
|
RSASSA-PKCS1-v1_5 with SHA-256 |
|
RSASSA-PKCS1-v1_5 with SHA-384 |
|
RSASSA-PKCS1-v1_5 with SHA-512 |
|
ECDSA with SHA-224 |
|
ECDSA with SHA-1 |
|
RSASSA-PKCS1-v1_5 with SHA-224 |
|
RSASSA-PKCS1-v1_5 with SHA-1 |
|
Cipher suites
TLS 1.3
TLS 1.3 cipher suites set the symmetric encryption only; key exchange and signatures are negotiated separately (lists above).
Classical
Standards: RFC 9846, FIPS 197, NIST SP 800-38D, NIST SP 800-38C, RFC 8439
Name |
Identifier |
|---|---|
AES-256-GCM with SHA-384 |
|
ChaCha20-Poly1305 with SHA-256 |
|
AES-128-GCM with SHA-256 |
|
AES-128-CCM with SHA-256 |
|
AES-128-CCM (8-byte tag) with SHA-256 |
|
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
Name (IANA) |
Identifier |
|---|---|
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 |
|
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 |
|
TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 |
|
TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 |
|
TLS_ECDHE_ECDSA_WITH_AES_256_CCM |
|
TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 |
|
TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384 |
|
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 |
|
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 |
|
TLS_ECDHE_ECDSA_WITH_AES_128_CCM |
|
TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 |
|
TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256 |
|
TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 |
|
TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 |
|
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 |
|
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 |
|
TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 |
|
TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 |
|
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 |
|
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 |
|
TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 |
|
TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 |
|
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA |
|
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA |
|
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA |
|
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA |
|
TLS_RSA_WITH_AES_256_GCM_SHA384 |
|
TLS_RSA_WITH_AES_256_CCM |
|
TLS_RSA_WITH_ARIA_256_GCM_SHA384 |
|
TLS_RSA_WITH_AES_128_GCM_SHA256 |
|
TLS_RSA_WITH_AES_128_CCM |
|
TLS_RSA_WITH_ARIA_128_GCM_SHA256 |
|
TLS_RSA_WITH_AES_256_CCM_8 |
|
TLS_RSA_WITH_AES_128_CCM_8 |
|
TLS_RSA_WITH_AES_256_CBC_SHA256 |
|
TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 |
|
TLS_RSA_WITH_AES_128_CBC_SHA256 |
|
TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 |
|
TLS_RSA_WITH_AES_256_CBC_SHA |
|
TLS_RSA_WITH_CAMELLIA_256_CBC_SHA |
|
TLS_RSA_WITH_AES_128_CBC_SHA |
|
TLS_RSA_WITH_CAMELLIA_128_CBC_SHA |
|
Certificate key types
TLS 1.3
PQC
Classical
Standards: RFC 5280, RFC 5958, RFC 3279, RFC 8017, RFC 4055, RFC 5480, NIST SP 800-186, RFC 5639, RFC 8410
Name |
Identifier |
|---|---|
RSA, 2048 bits and up |
|
RSA-PSS |
|
ECDSA NIST P-256 |
|
ECDSA NIST P-384 |
|
ECDSA NIST P-521 |
|
ECDSA Brainpool P-256r1 |
|
ECDSA Brainpool P-384r1 |
|
ECDSA Brainpool P-512r1 |
|
Ed25519 |
|
Ed448 |
|
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
Name |
Identifier |
|---|---|
RSA, 2048 bits and up |
|
RSA-PSS |
|
ECDSA NIST P-256 |
|
ECDSA NIST P-384 |
|
ECDSA NIST P-521 |
|
ECDSA Brainpool P-256r1 |
|
ECDSA Brainpool P-384r1 |
|
ECDSA Brainpool P-512r1 |
|
Ed25519 |
|
Ed448 |
|
7.2.4. Configuration¶
Helm values for an egress proxy: internal clients send plain HTTP, and the
gateway forwards to api.example.com over HTTPS with mTLS.
7.2.4.1. 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:
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)
7.2.4.1.1. plain → TLS¶
Plain clients; the gateway adds TLS and its client certificate towards the
partner (originate).
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
7.2.4.1.2. 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.
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 }
7.2.4.1.3. TLS → plain¶
Clients connect over (m)TLS; the gateway decrypts and forwards plain TCP to
an internal service (terminate).
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"
7.2.4.2. 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.
7.2.4.2.1. plain → TLS¶
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 }
7.2.4.2.2. TLS → TLS¶
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 }
7.2.4.2.3. TLS → plain¶
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"
7.2.4.3. One-way TLS¶
Only the server proves its identity: the gateway presents a certificate to clients, and checks the certificate of the upstream.
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
7.2.4.3.1. Clients → pqTLS¶
pqtls:
gateway:
certs:
from-clients:
certificate: gateway-server
7.2.4.3.2. pqTLS → upstream¶
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.
7.2.4.3.3. Use the profiles in a route¶
pqtls:
gateway:
routes:
- name: partner
ssl: reencrypt
listen:
port: 8443
tls: { certs: from-clients }
upstream:
address: "api.example.com:443"
tls: { certs: to-partner }
7.2.4.4. 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.
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
7.2.4.4.1. Clients → pqTLS¶
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)
7.2.4.4.2. pqTLS → upstream¶
pqtls:
gateway:
certs:
to-partner-mtls:
validation: { ca: partner-ca }
client_certificate: example-client
7.2.4.4.3. Use the profiles in a route¶
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 }
7.2.5. Exposing pqTLS¶
7.2.5.1. LoadBalancer¶
The chart creates a Service with one port per route, named
<protocol>-<port> (http-3128, tcp-9443). By default
it is ClusterIP: reachable inside the cluster at
<release>-qkdlite-pqtls.<namespace>:<port>.
To reach it from outside the cluster, use a LoadBalancer:
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
7.2.5.2. 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:
Gateway route |
Controller feature |
Backend |
|---|---|---|
|
TLS passthrough, host = a name in the gateway cert |
|
plain TCP ( |
TCP service on its own port |
|
|
a standard Ingress rule (host + path), no extras |
|
Examples of the vendor-specific part:
Controller |
TLS passthrough |
TCP |
|---|---|---|
Traefik |
|
|
Contour |
|
not supported (use Gateway API |
ingress-nginx (retired March 2026) |
annotation |
|
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.
7.2.5.3. 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:
Gateway route |
Listener |
Route object |
|---|---|---|
|
|
|
plain TCP ( |
|
|
|
|
|
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata: { name: shared, namespace: infra }
spec:
gatewayClassName: <vendor-class> # 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: <release>-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: <release>-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 anyservice.portsremap.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.allowsees the proxy’s pod IP, not the client’s. Restrict clients at the front proxy, and allow the proxy’s pod CIDR (or nothing) inlisten.allow.The forward proxy (
{host}) can only be exposed as TCP. ItsHostis the destination, not the gateway’s name, so host-based HTTP rules never match it.
7.2.6. Security Configuration¶
Each TLS side of a route uses a policy: TLS versions, ciphers and key exchange groups. Three policies are built in:
Policy |
Use for |
|---|---|
|
TLS 1.2 and 1.3 with modern ciphers. Prefers post-quantum key exchange,
falls back to classical. Used when a route sets no |
|
TLS 1.3 with post-quantum key exchange only. Clients without it are refused. |
|
Old clients or servers that need TLS 1.0 / 1.1 or older ciphers. |
Pick a policy per route side:
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:
pqtls:
gateway:
crypto:
default: pq
Define your own policy, or redefine a built-in (a name you define replaces the built-in completely):
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)