Skip to main content
Version: 3.10.x

Post-Quantum Cryptography

API7 Enterprise 3.10.9 and later support hybrid post-quantum key exchange (X25519MLKEM768) for TLS 1.3 connections by default. Combining classical X25519 with NIST FIPS 203 ML-KEM-768 protects API traffic against Harvest-Now, Decrypt-Later (HNDL) attacks while preserving automatic fallback for classical clients and upstreams.

For a cross-product comparison across API7 Enterprise, Apache APISIX, and AISIX AI Gateway, see the Post-Quantum Cryptography (PQC) Overview.

Version Requirements​

API7 Enterprise ReleaseData Plane RuntimeControl Plane TLS StackDefault PQC Status
3.10.9 and laterapisix-runtime with OpenSSL 3.5.9Go crypto/tls (Go 1.24+)Enabled by default (X25519MLKEM768 on TLS 1.3)
3.10.0 – 3.10.8OpenResty 1.29 / OpenSSL 3.4Go crypto/tlsNot available on the Data Plane; upgrade to 3.10.9 or later
3.9.x and earlierLegacy api7ee-runtime (OpenSSL 3.2)Go crypto/tlsNot available on the Data Plane; follow Upgrade from 3.9 to 3.10

Connection Coverage by Hop​

API7 Enterprise secures multiple network boundaries. The table below details PQC key-exchange coverage for each hop on 3.10.9 and later:

Connection HopTLS ImplementationHybrid PQC Key ExchangeNotes
Client to Gateway (HTTPS / TLS 1.3)OpenSSL 3.5.9X25519MLKEM768 (default)Requires TLSv1.3 in apisix.ssl.ssl_protocols (enabled by default). Older clients fall back to classical curves.
Gateway to Upstream (HTTPS / TLS 1.3)OpenSSL 3.5.9X25519MLKEM768 (default)Negotiated when the upstream supports TLS 1.3 and X25519MLKEM768; otherwise falls back to classical curves.
Data Plane to Control Plane (DP Manager port 7943 mTLS)OpenSSL 3.5.9 ↔ Go crypto/tlsX25519MLKEM768 (default)Applies to encrypted mTLS control channels on port 7943.
Dashboard, Developer Portal, and Admin API HTTPSGo crypto/tlsX25519MLKEM768 (default; Go 1.26+ also offers SecP256r1MLKEM768 and SecP384r1MLKEM1024)Applies when TLS is terminated directly on the Control Plane services.
Control Plane to External Registries, IdPs, and WebhooksGo crypto/tlsDefault Go hybrid ML-KEM groupsActive on TLS 1.3 outbound HTTPS calls (Consul, OIDC, webhooks).

Scope​

  • TLS 1.3 Key Exchange: API7 Enterprise protects TLS 1.3 key agreement with hybrid X25519MLKEM768 (NIST FIPS 203 ML-KEM-768 combined with X25519). Connections negotiated over TLS 1.2 continue to use classical ECDHE groups.
  • Certificates and Signatures: Classical RSA and ECDSA certificates are used for TLS authentication while post-quantum digital signature standards (NIST FIPS 204 ML-DSA and FIPS 205 SLH-DSA) mature across public certificate authorities and client ecosystems.

Verify PQC Negotiation​

Test with OpenSSL​

From a machine with OpenSSL 3.5 or newer, verify that the Gateway negotiates X25519MLKEM768 on TLS 1.3:

openssl s_client -connect "<gateway-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 graceful fallback for a classical-only client:

openssl s_client -connect "<gateway-host>:9443" -servername "<your-domain>" -tls1_3 -groups X25519 -brief </dev/null

Expected output reports a classical group such as Peer Temp Key: X25519, 253 bits.

Audit PQC Adoption in Gateway Access Logs​

To measure what percentage of client traffic uses X25519MLKEM768 for compliance reporting, include the NGINX $ssl_curve and $ssl_protocol variables in the Gateway access log format in conf/config.yaml:

conf/config.yaml
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

Connections negotiated with hybrid PQC log "TLSv1.3" "X25519MLKEM768", while classical connections log curves such as "X25519" or "prime256v1".

Configure or Opt Out of Hybrid Key Exchange​

Under normal operation, no extra configuration is required. If you need to restrict key-exchange groups or temporarily disable X25519MLKEM768 while upgrading legacy network equipment, use the options below.

Data Plane: Restrict Inbound or Upstream Groups​

In the Gateway conf/config.yaml (or configurationSnippet.httpSrv in the API7 Gateway Helm chart), add NGINX directives through nginx_config.http_server_configuration_snippet. Use proxy_ssl_conf_command to work around legacy network devices that drop the Gateway's oversized outbound ClientHello to upstreams; use ssl_ecdh_curve only for inbound group policy or to avoid oversized ServerHello responses (restricting server-side groups cannot prevent an appliance from dropping an inbound client's ClientHello, which is sent before the server responds):

conf/config.yaml
nginx_config:
http_server_configuration_snippet: |
# Restrict client-to-gateway TLS 1.3 groups to classical curves only:
ssl_ecdh_curve X25519:prime256v1:secp384r1;

# Restrict gateway-to-upstream HTTP proxy TLS 1.3 groups to classical curves only:
proxy_ssl_conf_command Groups X25519:prime256v1:secp384r1;

For L4 Stream TLS routes, apply the matching directives under nginx_config.stream_configuration_snippet.

To re-enable hybrid PQC explicitly with classical fallbacks, remove those lines or place X25519MLKEM768 first:

conf/config.yaml
nginx_config:
http_server_configuration_snippet: |
ssl_ecdh_curve X25519MLKEM768:X25519:prime256v1:secp384r1;
proxy_ssl_conf_command Groups X25519MLKEM768:X25519:prime256v1:secp384r1;
note

proxy_ssl_conf_command applies to HTTP/HTTPS proxy upstreams (proxy_pass). 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.

Control Plane: Emergency Opt-Out​

If a legacy network appliance blocks outbound hybrid PQC handshakes initiated by the Go-based Control Plane (or if you need the Control Plane to stop selecting ML-KEM groups on inbound handshakes), set the GODEBUG environment variable on the affected Control Plane deployment:

GODEBUG=tlsmlkem=0,tlssecpmlkem=0

Remove the override once the intermediate network device is updated.

Troubleshooting Legacy Network Devices​

Enabling X25519MLKEM768 adds roughly 1.1 KB to the TLS 1.3 ClientHello, increasing total packet size from ~300–500 bytes to ~1,200–1,500 bytes. When the ClientHello crosses the path MTU and splits across two TCP segments, older stateful firewalls, load balancers, or DPI appliances may stall or reset the connection.

Symptoms​

  • Upstream requests time out during the TLS handshake (upstream timed out or SSL_do_handshake() failed in Gateway error logs) immediately after upgrading to 3.10.9 or later.
  • Direct connections to the upstream without the intermediate appliance succeed.

Isolation and Resolution​

  1. Confirm whether the upstream path fails specifically with a PQC ClientHello by testing from a Gateway pod or host network with OpenSSL 3.5+:

    openssl s_client -connect "<upstream-host>:443" -tls1_3 -groups X25519MLKEM768 -brief </dev/null
    openssl s_client -connect "<upstream-host>:443" -tls1_3 -groups X25519 -brief </dev/null
  2. If X25519 succeeds while X25519MLKEM768 stalls or resets, inspect firewalls, NAT gateways, or TLS-inspecting proxies between the Gateway and the upstream and update their firmware to support multi-packet TLS 1.3 ClientHello messages.

  3. As a temporary mitigation during remediation, apply proxy_ssl_conf_command Groups X25519:prime256v1:secp384r1; in nginx_config.http_server_configuration_snippet and reload the Gateway.

Next Steps​