[php-src] PR #26064: ext/openssl: add SSL stream context option "groups"
| From: | adapik | Date: | Fri, 04 Dec 2026 11:03:16 +0000 |
| Subject: | [php-src] PR #26064: ext/openssl: add SSL stream context option "groups" | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-41412@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/26064
Author: adapik
Related to GH-22862.
Add a
groups SSL stream context option that sets the TLS key exchange groups of client
and server streams. OpenSSL lets applications choose the TLS key exchange groups, but PHP code
currently has no way to do it per stream.
```php
$context = stream_context_create(['ssl' => [
'groups' => 'X25519MLKEM768:X25519',
]]);
$client = stream_socket_client(
'tls://example.com:443',
context: $context,
);
```
This allows preferring or requiring a post-quantum hybrid group, restricting the groups to satisfy a
security policy, or disabling post-quantum groups for compatibility.
- The value is passed to OpenSSL as is. X25519MLKEM768 requires OpenSSL 3.5 or later.
- An invalid list fails the same way as an invalid ciphers string.
- Nothing changes when the option is not set.
ext/curl already exposes this as CURLOPT_SSL_EC_CURVES, streams have no equivalent.