-
Notifications
You must be signed in to change notification settings - Fork 310
Open
Description
Description
On systems with OpenSSL 3.6.0, the Encryption::createLocalKeyObject() method fails with:
openssl_pkey_new(): Private key length must be at least 384 bits, configured to 0
Environment
- PHP: 8.4 / 8.5
- OpenSSL: 3.6.0 (released October 2025)
- web-push: 10.0.1
Cause
OpenSSL 3.6 now requires an explicit private_key_bits parameter for EC key generation. The current code in
src/Encryption.php:254 does not provide this:
$keyResource = openssl_pkey_new([
'curve_name' => 'prime256v1',
'private_key_type' => OPENSSL_KEYTYPE_EC,
]);
Fix
Add private_key_bits to the options array:
$keyResource = openssl_pkey_new([
'curve_name' => 'prime256v1',
'private_key_type' => OPENSSL_KEYTYPE_EC,
'private_key_bits' => 384,
]);Metadata
Metadata
Assignees
Labels
No labels