laravel-notification-channels/webpush

error for vapid

Opened this issue · 5 comments

when i run
php artisan webpush:vapid

I have this error
RuntimeException

Unable to create the key

at vendor\web-token\jwt-core\Util\ECKey.php:98
94▕ 'curve_name' => self::getOpensslCurveName($curve),
95▕ 'private_key_type' => OPENSSL_KEYTYPE_EC,
96▕ ]);
97▕ if ($key === false) {
➜ 98▕ throw new RuntimeException('Unable to create the key');
99▕ }
100▕ $result = openssl_pkey_export($key, $out);
101▕ if ($result === false) {
102▕ throw new RuntimeException('Unable to create the key');

1 vendor\web-token\jwt-core\Util\ECKey.php:72
Jose\Component\Core\Util\ECKey::createECKeyUsingOpenSSL("P-256")

2 vendor\web-token\jwt-key-mgmt\JWKFactory.php:69
Jose\Component\Core\Util\ECKey::createECKey("P-256", [])

I also just ran into this error. macOS using the new Herd app that was released at Laracon US 2023.

I was able to generate the keys by using the php binary included in Homebrew. The binary provided by Herd does not appear to have all of the required extensions configured correctly to generate certs

Download and install openssl on your pc

@joshuasanjuan1717 I have a mac with openssl already installed. It's was a problem with the linked binary in my case.

+1 but on windows 10