From f5355f39b822b0d57a8e64fc47ce6357d0bdecf7 Mon Sep 17 00:00:00 2001 From: Madelyn Olson Date: Thu, 3 Dec 2026 00:23:48 -0800 Subject: [PATCH 1/2] Document post-quantum key exchange for TLS Valkey built against OpenSSL 3.5 or later negotiates hybrid ML-KEM key exchange (X25519MLKEM768) with no configuration, but the TLS page does not say so. Add a section covering the OpenSSL and TLS 1.3 requirements, how to check the negotiated group with openssl s_client, and how to require or prefer post-quantum groups with an OpenSSL configuration file, since Valkey has no directive for groups. Signed-off-by: Madelyn Olson --- topics/tls.md | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++ wordlist | 2 ++ 2 files changed, 69 insertions(+) diff --git a/topics/tls.md b/topics/tls.md index 55bef78c..4ca9cb8c 100644 --- a/topics/tls.md +++ b/topics/tls.md @@ -184,6 +184,73 @@ Additional TLS configuration is available to control the choice of TLS protocol versions, ciphers and cipher suites, etc. Please consult the self documented `valkey.conf` for more information. +### Post-quantum key exchange + +Traffic recorded today could be decrypted later by a quantum computer that can +break the elliptic curve key exchange TLS uses now. Hybrid post-quantum key +exchange protects against this by combining a classical group such as X25519 +with ML-KEM, the key encapsulation mechanism standardized in NIST FIPS 203. +The connection stays secure as long as either one holds. + +Valkey uses the key exchange groups provided by the OpenSSL library it was built +against. OpenSSL 3.5 and later support the hybrid group `X25519MLKEM768` and +prefer it by default. A Valkey server built with OpenSSL 3.5 or later uses it +with any client that supports it, without extra configuration. The official +Valkey container images ship OpenSSL 3.5. Earlier OpenSSL versions, including +the 3.0 series shipped by many long-term support distributions, do not support +ML-KEM. + +Keep these points in mind: + +* Post-quantum key exchange requires TLS 1.3. If you set `tls-protocols`, make + sure it includes `TLSv1.3`. +* Both sides of a connection must support it. This includes clients, replicas, + and cluster nodes that connect to each other. If one side does not support + it, the connection falls back to a classical group. + +To check what a server negotiates, connect with an OpenSSL 3.5 or later client: + +``` +openssl s_client -connect 127.0.0.1:6379 -tls1_3 -groups X25519MLKEM768 &1 | grep -i negotiated +``` + +A server that supports it prints: + +``` +Negotiated TLS1.3 group: X25519MLKEM768 +``` + +A server that does not support it prints `` as the group. + +Valkey has no directive for key exchange groups. To change them, use an OpenSSL +configuration file, which Valkey loads at startup. This example requires +post-quantum key exchange and rejects clients that support only classical +groups: + +``` +openssl_conf = openssl_init + +[openssl_init] +ssl_conf = ssl_module + +[ssl_module] +system_default = tls_defaults + +[tls_defaults] +Groups = X25519MLKEM768 +``` + +Point Valkey at the file with the `OPENSSL_CONF` environment variable: + +``` +OPENSSL_CONF=/path/to/openssl-pq.cnf valkey-server /path/to/valkey.conf +``` + +To prefer post-quantum key exchange while still accepting classical clients, +list more groups, for example `Groups = X25519MLKEM768:X25519:secp256r1`. This +setting applies to every TLS connection the server makes, including replication +and cluster bus connections. + ### Performance considerations TLS adds a layer to the communication stack with overheads due to writing/reading to/from an SSL connection, encryption/decryption and integrity checks. Consequently, using TLS results in a decrease of the achievable throughput per Valkey instance. diff --git a/wordlist b/wordlist index 2a1fcabe..8f6ebae1 100644 --- a/wordlist +++ b/wordlist @@ -199,6 +199,7 @@ Deauthenticate deauthenticate deauthenticated Deauthenticates +decrypted deduplicated deduplication Defrag @@ -1012,6 +1013,7 @@ whos-using-redis WQE WQEs WSL2 +X25519 x86 x86-64 xack From 48139f3fb233a00dd94bae6e3b22b4d8518b5d8f Mon Sep 17 00:00:00 2001 From: Madelyn Olson Date: Thu, 3 Dec 2026 00:30:47 -0800 Subject: [PATCH 2/2] Clarify what keeps a hybrid key exchange secure Signed-off-by: Madelyn Olson --- topics/tls.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/topics/tls.md b/topics/tls.md index 4ca9cb8c..665795e9 100644 --- a/topics/tls.md +++ b/topics/tls.md @@ -190,7 +190,7 @@ Traffic recorded today could be decrypted later by a quantum computer that can break the elliptic curve key exchange TLS uses now. Hybrid post-quantum key exchange protects against this by combining a classical group such as X25519 with ML-KEM, the key encapsulation mechanism standardized in NIST FIPS 203. -The connection stays secure as long as either one holds. +The connection stays secure as long as either ML-KEM or elliptic curve key exchange are secure. Valkey uses the key exchange groups provided by the OpenSSL library it was built against. OpenSSL 3.5 and later support the hybrid group `X25519MLKEM768` and