Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Vendor: The PHP Group · https://www.php.net/ · pkg:generic/php · Last reviewed 2026-12-05 · History

Summary

  • PHP built against OpenSSL 3.5 or later offers the hybrid group X25519MLKEM768 in TLS 1.3 by default, because PHP sets no group list; with an earlier OpenSSL it is classical.12
  • Streams have no option to choose TLS groups, so classical groups cannot be disabled per stream (checked 2026-12-05); a pull request to add one is open, and the curl extension has such an option.34
  • The openssl extension defines key types for classical algorithms only; a request for ML-KEM and ML-DSA support is open.56
  • The sodium extension has ML-KEM-768 and the X-Wing hybrid KEM from PHP 8.6 with libsodium 1.0.22 or later.7
  • The PHP project has published no commitment or roadmap for post-quantum support (checked 2026-12-05).

For curl extension requests, call curl_setopt($ch, CURLOPT_SSL_EC_CURVES, 'X25519MLKEM768:X25519'); to set groups explicitly.3

Disabling classical groups for PHP streams waits on pull request #26064, which adds a groups SSL context option and is not merged.4

Cryptographic operations

  • Outbound HTTPS and TLS streams (PHP is the client): the stream ssl context options include ciphers, security_level, min_proto_version and max_proto_version, but none for key exchange groups.1 In the PHP 8.4 source the only group code is a server-side ecdh_curve option compiled for OpenSSL older than 1.1.0.2 The connection uses OpenSSL’s default list.
  • PR #26064: “OpenSSL lets applications choose the TLS key exchange groups, but PHP code currently has no way to do it per stream.”4
  • curl extension: exposes CURLOPT_SSL_EC_CURVES and CURLOPT_SSL_SIGNATURE_ALGORITHMS; without them libcurl uses its TLS library’s default. See curl.3
  • TLS servers (stream_socket_server()): group list is OpenSSL’s default; TLS is usually terminated by a web server such as nginx.
  • Keys and signatures: key types are OPENSSL_KEYTYPE_RSA, _DSA, _DH, _EC, _X25519, _ED25519, _X448, _ED448; none for ML-KEM, ML-DSA or SLH-DSA (checked 2026-12-05).5 PR #26063: “With OpenSSL 3.5+, part of the post-quantum support already works in ext/openssl without any code changes, but nothing covers it.”8
  • Sodium (8.6): sodium_crypto_kem_* for X-Wing (“hybrid ML-KEM768+X25519, libsodium’s recommended KEM”) and sodium_crypto_kem_mlkem768_*, “available when PHP is built against libsodium >= 1.0.22”. They do not change TLS.7

Versions

Change Version Date Package URL Source
X-Wing and ML-KEM-768 KEM functions in sodium (libsodium 1.0.22 or later) 8.6.0 2026-11-19 pkg:generic/php@8.6.0 79

No PHP release has changed TLS group handling; hybrid TLS key agreement arrives with OpenSSL 3.5.0.

Configuration

Enabling PQC

Streams: nothing can be set in PHP; check the OpenSSL version, where 3.5.0 or later offers X25519MLKEM768:

php -r 'echo OPENSSL_VERSION_TEXT, PHP_EOL;'

Disabling classical algorithms

  • Streams: not possible from PHP code (checked 2026-12-05); the proposed groups option would allow it.4
  • curl extension: set CURLOPT_SSL_EC_CURVES to 'X25519MLKEM768' (needs libcurl built with OpenSSL or wolfSSL); a server without the group fails the handshake.
  • System-wide: OpenSSL’s configuration file; see OpenSSL.

Open work

Status as of 2026-12-05.

  • requested: issue #22862, “Add Post-Quantum Cryptography Support”, opened 2026-07-22.6
  • in progress: PR #26064, “ext/openssl: add SSL stream context option “groups””, opened 2026-12-04, not merged.4
  • in progress: PR #26063, “ext/openssl: Add tests for PQC key support”, opened 2026-12-04, not merged; changes no source code.8
  • Issue #23421, “OpenSSL: Expose Post-Quantum Cryptography (PQC) functionality”, opened 2026-08-23, closed as a duplicate 2026-08-25.10

Distributions

Checked 2026-12-05. The last column is derived from the OpenSSL series; the proofs test it. Official Docker images compile PHP against the base image’s OpenSSL dev package, so trixie and bookworm variants differ; php:8.4-cli pointed at trixie when checked.11

Distribution PHP OpenSSL Hybrid TLS key agreement from streams Source
Debian 12 (bookworm) 8.2 3.0.22 no 1213
Debian 13 (trixie) 8.4 3.5.10 yes 1415
Ubuntu 22.04 (jammy) 8.1 3.0.2 no 1617
Ubuntu 24.04 (noble) 8.3 3.0.13 no 1819
Ubuntu 26.04 (resolute) 8.5 3.5.5 yes 2021
Alpine 3.25 8.4.28 (php84), 8.5.13 (php85) 3.5.10 yes 2223
Docker official image php:8.4-cli 8.4.28 from debian:trixie-slim yes 1115
Docker official image php:8.4-cli-bookworm 8.4.28 from debian:bookworm-slim no 1113
Docker official image php:8.4-cli-alpine 8.4.28 from alpine:3.24 (3.5.10) yes 1124

Proofs

References

  1. PHP manual, SSL context options. https://www.php.net/manual/en/context.ssl.php (accessed 2026-12-05) ↩ ↩2

  2. php-src, branch PHP-8.4 at commit 497318f, ext/openssl/xp_ssl.c, php_openssl_set_server_ecdh_curve. https://github.com/php/php-src/blob/497318f0e65d527e617961cdb7a3a91293dcb303/ext/openssl/xp_ssl.c#L1356-L1391 (accessed 2026-12-05) ↩ ↩2

  3. php-src, ext/curl/curl.stub.php, CURLOPT_SSL_EC_CURVES, at commit 94519df. https://github.com/php/php-src/blob/94519df8b69ad4c886789b983254695675de22c0/ext/curl/curl.stub.php#L3397-L3405 (accessed 2026-12-05) ↩ ↩2 ↩3

  4. php-src pull request #26064, “ext/openssl: add SSL stream context option “groups””. https://github.com/php/php-src/pull/26064 (accessed 2026-12-05) ↩ ↩2 ↩3 ↩4 ↩5

  5. php-src, ext/openssl/openssl.stub.php, key type constants, at commit 94519df. https://github.com/php/php-src/blob/94519df8b69ad4c886789b983254695675de22c0/ext/openssl/openssl.stub.php#L407-L450 (accessed 2026-12-05) ↩ ↩2

  6. php-src issue #22862, “Add Post-Quantum Cryptography Support”. https://github.com/php/php-src/issues/22862 (accessed 2026-12-05) ↩ ↩2

  7. php-src, branch PHP-8.6 at commit 474d5e0, UPGRADING, Sodium section. https://github.com/php/php-src/blob/474d5e0805abd78d145cddea8cec6393856177d6/UPGRADING#L868-L879 (accessed 2026-12-05) ↩ ↩2 ↩3

  8. php-src pull request #26063, “ext/openssl: Add tests for PQC key support”. https://github.com/php/php-src/pull/26063 (accessed 2026-12-05) ↩ ↩2

  9. PHP releases, 8.6.0 dated 19 Nov 2026. https://www.php.net/releases/index.php (accessed 2026-12-05) ↩

  10. php-src issue #23421, “OpenSSL: Expose Post-Quantum Cryptography (PQC) functionality”. https://github.com/php/php-src/issues/23421 (accessed 2026-12-05) ↩

  11. docker-library/php, Dockerfiles for 8.4 at commit 8f7cce4, and the official-images tag list. https://github.com/docker-library/php/tree/8f7cce49542f60a52d87a852a46a734cc1de78fc/8.4 and https://github.com/docker-library/official-images/blob/master/library/php (accessed 2026-12-05) ↩ ↩2 ↩3 ↩4

  12. Debian package php-cli in bookworm. https://packages.debian.org/bookworm/php-cli (accessed 2026-12-05) ↩

  13. Debian package openssl in bookworm. https://packages.debian.org/bookworm/openssl (accessed 2026-12-05) ↩ ↩2

  14. Debian package php-cli in trixie. https://packages.debian.org/trixie/php-cli (accessed 2026-12-05) ↩

  15. Debian package openssl in trixie. https://packages.debian.org/trixie/openssl (accessed 2026-12-05) ↩ ↩2

  16. Ubuntu package php-cli in jammy. https://packages.ubuntu.com/jammy/php-cli (accessed 2026-12-05) ↩

  17. Ubuntu package openssl in jammy. https://packages.ubuntu.com/jammy/openssl (accessed 2026-12-05) ↩

  18. Ubuntu package php-cli in noble. https://packages.ubuntu.com/noble/php-cli (accessed 2026-12-05) ↩

  19. Ubuntu package openssl in noble. https://packages.ubuntu.com/noble/openssl (accessed 2026-12-05) ↩

  20. Ubuntu package php-cli in resolute. https://packages.ubuntu.com/resolute/php-cli (accessed 2026-12-05) ↩

  21. Ubuntu package openssl in resolute. https://packages.ubuntu.com/resolute/openssl (accessed 2026-12-05) ↩

  22. Alpine packages php84 and php85, branch v3.25. https://pkgs.alpinelinux.org/packages?name=php8*&branch=v3.25&arch=x86_64 (accessed 2026-12-05) ↩

  23. Alpine package openssl, branch v3.25. https://pkgs.alpinelinux.org/packages?name=openssl&branch=v3.25&arch=x86_64 (accessed 2026-12-05) ↩

  24. Alpine package openssl, branch v3.24. https://pkgs.alpinelinux.org/packages?name=openssl&branch=v3.24&arch=x86_64 (accessed 2026-12-05) ↩


Edit: PHP

If you give an email address it is recorded publicly as the author of the commit, and GitHub will link the commit to your account if that address belongs to one.

Edits are reviewed before they appear. By submitting you release your contribution under CC BY-SA 4.0. Read the editorial guidelines first.

This site uses Just the Docs, a documentation theme for Jekyll.