Skip to content

openssl_pkey_new(): Private key length must be at least 384 bits, configured to 0 #213

Closed
@101Admin

Description

@101Admin

When running the php artisan webpush:vapid command i get the following error:

   ErrorException 

  openssl_pkey_new(): Private key length must be at least 384 bits, configured to 0

  at vendor/web-token/jwt-library/Core/Util/ECKey.php:92
     88▕     {
     89▕         if (! extension_loaded('openssl')) {
     90▕             throw new RuntimeException('Please install the OpenSSL extension');
     91▕         }
  ➜  92▕         $key = openssl_pkey_new([
     93▕             'curve_name' => self::getOpensslCurveName($curve),
     94▕             'private_key_type' => OPENSSL_KEYTYPE_EC,
     95▕         ]);
     96▕         if ($key === false) {

      +18 vendor frames 

  19  artisan:13
      Illuminate\Foundation\Application::handleCommand(Object(Symfony\Component\Console\Input\ArgvInput))

I am using the latest version of the package:

"laravel-notification-channels/webpush": "^10.2",

I am running the latest version of OpenSSl:

OpenSSL 3.5.1 1 Jul 2025 (Library: OpenSSL 3.5.1 1 Jul 2025)
built on: Tue Jul  1 11:52:08 2025 UTC
platform: darwin64-arm64-cc
options:  bn(64,64)
compiler: clang -fPIC -arch arm64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -D_REENTRANT -DOPENSSL_BUILDING_OPENSSL -DNDEBUG
OPENSSLDIR: "/opt/homebrew/etc/openssl@3"
ENGINESDIR: "/opt/homebrew/Cellar/openssl@3/3.5.1/lib/engines-3"
MODULESDIR: "/opt/homebrew/Cellar/openssl@3/3.5.1/lib/ossl-modules"
Seeding source: os-specific
CPUINFO: OPENSSL_armcap=0x987d

And running php version 8.4:

PHP 8.4.10 (cli) (built: Jul  4 2025 00:25:55) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.4.10, Copyright (c) Zend Technologies
    with Zend OPcache v8.4.10, Copyright (c), by Zend Technologies

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions