Post-Quantum Cryptography
Apache APISIX 3.20.0 and later support hybrid post-quantum key exchange (X25519MLKEM768) on TLS 1.3 connections by default. This hybrid group combines classical X25519 with NIST FIPS 203 ML-KEM-768 to protect data in transit against Harvest-Now, Decrypt-Later (HNDL) attacks while automatically falling back to classical curves for peers that do not support PQC.
For a cross-product overview covering Apache APISIX, API7 Gateway, and AISIX AI Gateway, see the Post-Quantum Cryptography (PQC) Overview.
Version Requirements
Hybrid post-quantum key exchange depends on OpenSSL 3.5 or newer bundled inside apisix-runtime:
| Apache APISIX Version | Bundled apisix-runtime | OpenSSL Version | Default PQC Status |
|---|---|---|---|
3.20.0 and later | 1.4.2+ | 3.5.9+ | Enabled by default (X25519MLKEM768 in TLS 1.3) |
3.19.0 and earlier | 1.3.x and earlier | 3.4.x / 3.2.x | Not available; upgrade to 3.20.0 or later |
If you build APISIX from source against a custom OpenResty or OpenSSL installation, verify that NGINX is linked against OpenSSL 3.5.0 or later (openresty -V).
Connection Coverage by Hop
| Connection Hop | TLS Implementation | Hybrid PQC Key Exchange | Notes |
|---|---|---|---|
| Client to APISIX (HTTPS / TLS 1.3) | OpenSSL 3.5.9+ | X25519MLKEM768 (default) | Requires TLSv1.3 in apisix.ssl.ssl_protocols (enabled by default). |
| APISIX to Upstream (HTTPS / TLS 1.3) | OpenSSL 3.5.9+ | X25519MLKEM768 (default) | Negotiated when the upstream supports TLS 1.3 and X25519MLKEM768; otherwise falls back automatically. |
| APISIX to etcd (HTTPS / mTLS) | OpenSSL 3.5.9+ ↔ etcd Go crypto/tls | X25519MLKEM768 when etcd runs on Go 1.24+ | Falls back to classical curves with older etcd binaries. |
Scope
- TLS 1.3 Key Exchange: APISIX protects TLS 1.3 key agreement via hybrid
X25519MLKEM768(NIST FIPS 203ML-KEM-768combined withX25519). TLS 1.2 connections continue to use classical ECDHE curves. - Certificates and Signatures: Classical RSA and ECDSA certificates are used for TLS authentication while post-quantum digital signature standards (NIST FIPS 204
ML-DSAand FIPS 205SLH-DSA) mature across public certificate authorities and client ecosystems.
Verify PQC Negotiation
Test with OpenSSL
From a client with OpenSSL 3.5 or newer, verify that APISIX negotiates X25519MLKEM768:
openssl s_client -connect "<apisix-host>:9443" -servername "<your-domain>" -tls1_3 -groups X25519MLKEM768:X25519 -brief </dev/null
Expected output includes:
Protocol version: TLSv1.3
Negotiated TLS1.3 group: X25519MLKEM768
Verify classical fallback by offering only X25519:
openssl s_client -connect "<apisix-host>:9443" -servername "<your-domain>" -tls1_3 -groups X25519 -brief </dev/null
Expected output includes Peer Temp Key: X25519, 253 bits.
Log Negotiated Groups in Access Logs
Record the NGINX $ssl_protocol and $ssl_curve variables in conf/config.yaml to monitor PQC traffic share:
nginx_config:
http:
enable_access_log: true
access_log_format: '$remote_addr - $remote_user [$time_local] $http_host "$request" $status $body_bytes_sent $request_time "$ssl_protocol" "$ssl_curve"'
access_log_format_escape: default
Configure or Disable Hybrid Key Exchange
No configuration change is needed to use X25519MLKEM768 on APISIX 3.20.0 and later. If an intermediate network appliance between APISIX and an upstream drops oversized outbound ClientHello packets, restrict outbound groups with proxy_ssl_conf_command in nginx_config.http_server_configuration_snippet. You can also set ssl_ecdh_curve for inbound group policy or to shrink ServerHello responses (note that restricting server-side groups cannot fix an appliance dropping an inbound client's ClientHello, which requires fixing the network device or adjusting the client):
nginx_config:
http_server_configuration_snippet: |
# Restrict client-to-APISIX TLS 1.3 key exchange to classical curves:
ssl_ecdh_curve X25519:prime256v1:secp384r1;
# Restrict APISIX-to-upstream HTTP proxy TLS 1.3 key exchange to classical curves:
proxy_ssl_conf_command Groups X25519:prime256v1:secp384r1;
For L4 Stream TLS routes, place the equivalent directives in nginx_config.stream_configuration_snippet.
To explicitly prioritize X25519MLKEM768 with classical fallbacks:
nginx_config:
http_server_configuration_snippet: |
ssl_ecdh_curve X25519MLKEM768:X25519:prime256v1:secp384r1;
proxy_ssl_conf_command Groups X25519MLKEM768:X25519:prime256v1:secp384r1;
proxy_ssl_conf_command applies to NGINX proxy_pass HTTPS upstreams. For grpcs:// upstreams (grpc_pass), also add grpc_ssl_conf_command Groups X25519:prime256v1:secp384r1; in http_server_configuration_snippet. For the HTTPS Admin API listener, add ssl_ecdh_curve in nginx_config.http_admin_configuration_snippet.
Troubleshooting Legacy Network Devices
Adding an ML-KEM-768 key share enlarges the TLS 1.3 ClientHello to roughly 1,200–1,500 bytes, which frequently spans two TCP segments. Older firewalls, load balancers, or deep packet inspection devices may drop or reset fragmented ClientHello handshakes.
-
Run a comparative handshake test against the affected upstream from the APISIX host:
openssl s_client -connect "<upstream-host>:443" -tls1_3 -groups X25519MLKEM768 -brief </dev/nullopenssl s_client -connect "<upstream-host>:443" -tls1_3 -groups X25519 -brief </dev/null -
If
X25519succeeds whileX25519MLKEM768times out or resets, upgrade or reconfigure the intermediate network device to allow multi-packet TLS 1.3ClientHellomessages. -
While remediating the network path, use
proxy_ssl_conf_command Groups X25519:prime256v1:secp384r1;innginx_config.http_server_configuration_snippetas a temporary workaround.
Next Steps
- Read the Post-Quantum Cryptography (PQC) Overview.
- Configure HTTPS Between Client and APISIX and Upstream HTTPS.
- Configure Data Encryption with Keyring for secrets at rest.