Skip to main content

Post-quantum TLS

Starting from v18.2.0, Otoroshi negotiates hybrid post-quantum key exchanges on the TLS 1.3 connections it terminates: over HTTPS when it runs on JDK 25.0.5 or later, or JDK 27 or later (for instance with the default Docker image, built on JDK 25), and over HTTP/3 on any JDK. It is enabled by default: TLS 1.3 clients that support post-quantum key exchange (recent browsers, OpenSSL 3.5 and later, curl built against it, Java 27, ...) get a session protected against future quantum computers, and the other clients keep using a classical key exchange, exactly as before. The same goes for the calls Otoroshi makes to its backends: it offers the hybrid groups first, and falls back to a classical key exchange with the backends that do not support them.

Why it matters​

Harvest now, decrypt later​

The key exchanges used by TLS today (ECDHE on elliptic curves, DHE on finite fields) rely on mathematical problems that a large enough quantum computer could solve with Shor's algorithm. Such a machine does not exist yet, but an attacker does not need one today: it can record encrypted traffic now and decrypt it later, once the machine exists.

Everything that goes through your gateway and must stay confidential for years is exposed to this attack right now: personal data, health or financial records, credentials and tokens sent in headers, internal API payloads. The only protection is to stop using a quantum-vulnerable key exchange before the traffic is recorded.

Why the key exchange comes first​

TLS uses public key cryptography for two different jobs:

  • the key exchange, which derives the session keys that encrypt the traffic. If it can be broken later, recorded sessions can be decrypted retroactively
  • the authentication (certificates and signatures), which proves the identity of the server. Breaking it later does not help an attacker: it would have to impersonate the server during the handshake itself

This is why the industry migrates the key exchange first. Post-quantum certificates are a separate, later step, and they are not covered by this page.

Why now​

NIST published the ML-KEM standard (FIPS 203) in August 2024, the major browsers and TLS libraries now negotiate hybrid post-quantum key exchange by default, and JDK 27 brought it to the Java TLS stack (JEP 527), backported to the JDK 25 updates from JDK 25.0.5. In December 2026, US agencies (NSA, CISA and the Office of the National Cyber Director) called on organizations to accelerate their migration to post-quantum cryptography, a call publicly backed by several major technology companies.

An API gateway is one of the best places to start: it terminates TLS for many applications at once, so enabling post-quantum key exchange there protects all of them without touching their code.

Hybrid key exchange in a nutshell​

ML-KEM (Module-Lattice-Based Key-Encapsulation Mechanism, FIPS 203) is the key establishment algorithm standardized by NIST to resist quantum computers.

A hybrid key exchange runs a classical elliptic curve exchange and an ML-KEM exchange in the same TLS 1.3 handshake, and combines both secrets. The session stays safe as long as at least one of the two algorithms is unbroken: it is protected against a future quantum computer by ML-KEM, and against a possible weakness of the much younger ML-KEM by the classical curve.

Otoroshi supports the three hybrid groups specified by the IETF (draft-ietf-tls-ecdhe-mlkem):

Named groupClassical partPost-quantum partTypical use
X25519MLKEM768X25519ML-KEM-768The one offered by default by browsers and most TLS libraries
SecP256r1MLKEM768P-256ML-KEM-768Environments that require NIST curves
SecP384r1MLKEM1024P-384ML-KEM-1024Higher security level. ML-KEM-1024 is the parameter set required by CNSA 2.0

Hybrid groups only exist in TLS 1.3. A client that negotiates TLS 1.2 always gets a classical key exchange.

The cost is small. ML-KEM is fast, comparable to an elliptic curve exchange. The handshake is bigger: with X25519MLKEM768, the client key share grows from 32 bytes to about 1.2 KB and the server key share to about 1.1 KB.

Requirements and scope​

Post-quantum key exchange requires Otoroshi v18.2.0 or later. The rest depends on the protocol, because HTTPS and HTTP/3 rely on two different TLS stacks:

  • HTTPS (HTTP/1.1 and HTTP/2 over TLS) uses the JDK TLS stack and requires a JDK that knows the hybrid groups: JDK 25.0.5 or later (JEP 527 was backported to the JDK 25 updates), or JDK 27 or later. On older JDKs, JDK 26 included, the setting is ignored and the JVM defaults apply, which only contain classical groups
  • HTTP/3 (QUIC) uses BoringSSL, through netty, and supports X25519MLKEM768 on any JDK

The default Docker image runs on JDK 25, the current LTS release of Java: from JDK 25.0.5, it negotiates post-quantum key exchange over HTTPS too. The JDK 27 variants of the image work as well:

docker pull maif/otoroshi:18.2.0-jdk27

An Amazon Corretto based variant is also published with the -correto-jdk27 suffix. When you run the Otoroshi jar directly, check the Java version of your runtime with java -version.

The key exchange groups of each kind of connection:

ConnectionKey exchange groups
HTTPS on the main Otoroshi portotoroshi.ssl.namedGroups, on JDK 25.0.5+ or 27+
Netty server (HTTP/1.1 and HTTP/2 over TLS)otoroshi.ssl.namedGroups, on JDK 25.0.5+ or 27+
Custom HTTP listenersThe namedGroups of the listener, or otoroshi.ssl.namedGroups when it is empty, see Per listener
HTTP/3 (QUIC), on the Netty server and on custom listenersThe groups of the same list that BoringSSL supports, on any JDK, see HTTP/3
TCP services: TLS terminationNot configurable, JVM defaults
Calls to backends: HTTP/1.1, HTTP/2, websockets, TLS to TCP service targetsotoroshi.ssl.outboundNamedGroups, on JDK 25.0.5+ or 27+, see Outbound calls
Calls to backends: HTTP/3The groups of otoroshi.ssl.outboundNamedGroups that BoringSSL supports, on any JDK

HTTP/3​

HTTP/3 runs over QUIC, whose TLS stack is BoringSSL (bundled with netty), not the JDK. It does not depend on the JDK version, but it only supports part of the groups:

Named groupsOver HTTP/3
X25519MLKEM768Yes
SecP256r1MLKEM768, SecP384r1MLKEM1024No
x25519, secp256r1, secp384r1, secp521r1Yes
x448, ffdhe2048, ffdhe3072, ffdhe4096No

Otoroshi leaves the groups that BoringSSL does not support out of the HTTP/3 list. With the default list, HTTP/3 uses X25519MLKEM768, x25519, secp256r1, secp384r1, secp521r1. If no group of the list is supported, HTTP/3 falls back to the BoringSSL defaults (classical groups only) and logs a warning. QUIC always uses TLS 1.3, so every HTTP/3 client that supports X25519MLKEM768 gets a post-quantum key exchange.

Configuration​

Everything is under otoroshi.ssl:

otoroshi.ssl {
# hybrid groups only: clients without post-quantum support are rejected
postQuantumHybridOnlyNamedGroups = ["X25519MLKEM768", "SecP256r1MLKEM768", "SecP384r1MLKEM1024"]
# hybrid groups first, then the classical ones
postQuantumHybridWithClassicalFallbacksNamedGroups = ["X25519MLKEM768", "SecP256r1MLKEM768", "SecP384r1MLKEM1024", "x25519", "secp256r1", "secp384r1", "secp521r1", "x448", "ffdhe2048", "ffdhe3072", "ffdhe4096"]

# the key exchange groups used for TLS termination
namedGroups = ${otoroshi.ssl.postQuantumHybridWithClassicalFallbacksNamedGroups}
# or as a comma-separated string via env variable (takes precedence over namedGroups)
namedGroupsStr = ${?OTOROSHI_SSL_NAMED_GROUPS}

# the key exchange groups offered when otoroshi calls backends over TLS
outboundNamedGroups = ${otoroshi.ssl.postQuantumHybridWithClassicalFallbacksNamedGroups}
# or as a comma-separated string via env variable (takes precedence over outboundNamedGroups)
outboundNamedGroupsStr = ${?OTOROSHI_SSL_OUTBOUND_NAMED_GROUPS}
}

The setting is read at startup: restart Otoroshi to apply a change.

Default: hybrid with classical fallbacks​

By default, namedGroups contains the three hybrid groups followed by the classical ones. On JDK 27, this is the default list of the JDK plus SecP256r1MLKEM768 and SecP384r1MLKEM1024 (JDK 25 also enables ffdhe6144 and ffdhe8192 by default, the list leaves them out), so no existing client loses access: clients that support post-quantum key exchange use it, the others negotiate a classical group as before.

When Otoroshi starts on JDK 25.0.5+ or 27+, the otoroshi-ssl-provider logger prints the active list at the INFO level:

Using TLS named groups: X25519MLKEM768, SecP256r1MLKEM768, SecP384r1MLKEM1024, x25519, secp256r1, secp384r1, secp521r1, x448, ffdhe2048, ffdhe3072, ffdhe4096

If this line is missing, check the Java version: before JDK 25.0.5, and on JDK 26, the setting is ignored over HTTPS and only classical key exchanges are available.

When HTTP/3 is enabled, the otoroshi-experimental-netty-http3-server logger prints, at startup and on any JDK, the groups used over HTTP/3 and the ones left out:

Using TLS named groups for http3: X25519MLKEM768, x25519, secp256r1, secp384r1, secp521r1 (not supported by the http3 tls stack: SecP256r1MLKEM768, SecP384r1MLKEM1024, x448, ffdhe2048, ffdhe3072, ffdhe4096)

Hybrid-only mode​

To refuse any TLS 1.3 connection that is not protected by a post-quantum key exchange, use the hybrid-only list:

otoroshi.ssl {
namedGroups = ${otoroshi.ssl.postQuantumHybridOnlyNamedGroups}
# TLS 1.2 has no hybrid key exchange, see below
protocols = ["TLSv1.3"]
}

or with the env variable:

OTOROSHI_SSL_NAMED_GROUPS="X25519MLKEM768,SecP256r1MLKEM768,SecP384r1MLKEM1024"
warning

In hybrid-only mode, every client that does not support post-quantum key exchange is rejected: older browsers, older OpenSSL versions, Java clients older than JDK 25.0.5 or 27, many SDKs and devices. Check your client population before enabling it.

Over HTTPS, restricting the named groups is not enough on its own: as long as TLS 1.2 is enabled, a TLS 1.2 client can still connect with a classical DHE cipher suite. To make sure every connection uses a post-quantum key exchange, also set otoroshi.ssl.protocols = ["TLSv1.3"].

Over HTTP/3, the hybrid-only list leaves X25519MLKEM768 alone, the only hybrid group BoringSSL supports, and no TLS 1.2 fallback exists.

Custom list​

You can list any group supported by the JDK, for instance only the NIST-curve hybrids and their classical counterparts:

OTOROSHI_SSL_NAMED_GROUPS="SecP256r1MLKEM768,SecP384r1MLKEM1024,secp256r1,secp384r1"

Keep in mind that:

  • over HTTPS, names that the JDK does not know are ignored, but if no group of the list is usable, every TLS handshake fails. Double-check the spelling of the names
  • over HTTP/3, the groups that BoringSSL does not support are left out, and its defaults apply when none remains
  • an empty list, or a blank env variable, is ignored and the defaults of the TLS stack apply
  • the list applies to every TLS listener of the instance, except the custom HTTP listeners that set their own list

Per listener​

A custom HTTP listener can set its own groups with the namedGroups field of its configuration, over HTTPS and HTTP/3. An empty list (the default) inherits otoroshi.ssl.namedGroups. For instance, a listener that only accepts post-quantum key exchanges, next to the standard listener that keeps accepting every client:

{
"id": "http-listener_post_quantum",
"name": "Post-quantum listener",
"config": {
"enabled": true,
"tls": true,
"http1": true,
"http2": true,
"http3": true,
"port": 9444,
"exposedPort": 9444,
"clientAuth": "None",
"namedGroups": ["X25519MLKEM768", "SecP256r1MLKEM768", "SecP384r1MLKEM1024"]
}
}

The same rules apply: over HTTPS, the list is only applied on JDK 25.0.5+ or 27+, and TLS 1.2 stays possible as long as otoroshi.ssl.protocols allows it (the TLS protocols are shared by every listener).

Outbound calls​

The traffic between Otoroshi and the backends crosses networks too, and can be recorded as well. otoroshi.ssl.outboundNamedGroups (or the OTOROSHI_SSL_OUTBOUND_NAMED_GROUPS env variable, comma-separated) lists the key exchange groups Otoroshi offers when it calls a backend over TLS. It is kept apart from namedGroups on purpose: refusing classical clients on the listeners must not cut the backends that only support classical key exchanges.

By default it contains the hybrid groups first, then the classical ones. A backend that supports post-quantum key exchange gets X25519MLKEM768, the others keep negotiating a classical group. With the JDK TLS stack, the client sends both an X25519MLKEM768 and an x25519 key share in its first message, so a backend that only supports x25519 does not cost an extra round trip, exactly as with the JDK defaults.

The list applies to:

ClientUsed forApplied
Pekko HTTPHTTP/1.1 targets, websocketsOn JDK 25.0.5+ or 27+
NettyHTTP/2 targets (and HTTP/1.1 ones when the netty client is enforced)On JDK 25.0.5+ or 27+
Netty QUIC (BoringSSL)HTTP/3 targetsOn any JDK, only the groups BoringSSL supports (X25519MLKEM768, x25519, secp256r1, secp384r1, secp521r1)
TCP servicesTLS connections to the targets of a TCP serviceOn JDK 25.0.5+ or 27+

At startup on JDK 25.0.5+ or 27+, the otoroshi-ssl-provider logger prints the list:

Using TLS named groups for outbound calls: X25519MLKEM768, SecP256r1MLKEM768, SecP384r1MLKEM1024, x25519, secp256r1, secp384r1, secp521r1, x448, ffdhe2048, ffdhe3072, ffdhe4096

and, at the first call to an HTTP/3 backend, the otoroshi-experimental-netty-http3-client logger prints the groups used over HTTP/3:

Using TLS named groups for outbound http3 calls: X25519MLKEM768, x25519, secp256r1, secp384r1, secp521r1

To only talk to backends over a post-quantum key exchange, use the hybrid-only list: the calls to the backends that do not support it then fail.

OTOROSHI_SSL_OUTBOUND_NAMED_GROUPS="X25519MLKEM768,SecP256r1MLKEM768,SecP384r1MLKEM1024"

The other outbound calls of Otoroshi (the ones made by authentication modules or data exporters, for instance) use the defaults of their TLS stack: on JDK 25.0.5+ or 27+, the JDK already offers X25519MLKEM768 first. The JVM-wide jdk.tls.namedGroups system property sets the list for every TLS connection made with the JDK stack, if you need to change it there too.

Checking what a client negotiates​

With OpenSSL​

OpenSSL 3.5 and later support the hybrid groups. Force X25519MLKEM768 and look at the negotiated group:

openssl s_client -connect myapi.oto.tools:8443 -servername myapi.oto.tools \
-groups X25519MLKEM768 </dev/null 2>/dev/null | grep "Negotiated TLS1.3 group"
Negotiated TLS1.3 group: X25519MLKEM768

If the server does not support the group, the handshake fails with a TLS alert. Without the -groups option, OpenSSL 3.5 and later already prefer X25519MLKEM768, so the same line tells you what a default client gets.

With curl​

curl reports the group when it is built against OpenSSL 3.5 or later (curl --version shows the TLS library in use):

curl -sv --curves X25519MLKEM768 https://myapi.oto.tools:8443/ -o /dev/null 2>&1 | grep "SSL connection"
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384 / X25519MLKEM768 / id-ecPublicKey

Over HTTP/3, with a curl that supports it (HTTP3 in the features of curl --version) and the HTTP/3 port of the Netty server (10048 by default) or of a listener:

curl -sv --http3-only --curves X25519MLKEM768 https://myapi.oto.tools:10048/ -o /dev/null 2>&1 | grep "SSL connection"

The output is the same SSL connection using TLSv1.3 / ... / X25519MLKEM768 / ... line.

With a browser​

Recent versions of Chrome, Edge, Firefox and Safari offer X25519MLKEM768 by default. In Chrome and Edge, the security panel of the developer tools shows the key exchange group used by the connection.

References​

  • TLS - TLS termination, mTLS and the other otoroshi.ssl settings
  • Netty server - Alternative HTTP server and its TLS configuration
  • Custom HTTP Listeners - Additional listeners, with their own key exchange groups
  • HTTP/3 support - HTTP/3 server, with its own TLS stack