Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

211
Vistas
PHP: openssl_seal(): not a public key (1th member of pubkeys)

I am cloning a repo of a Laravel project. I clone the repo and do php artisan key: generate which correctly sets the keys in .env. However when the app makes an external API request, it fails with the error

openssl_seal(): not a public key (1th member of pubkeys)

I have checked and the env('API_KEY') and 'API_URL' variables are correct.

public static function request(string $url, $data = []): Response
{
    //This is where the code fails
    $encrypt_result = self::encrypt($data, env('API_KEY'));

    return Http::asForm()->post(env('API_URL') . $url, [
        'key' => env('API_KEY'),
        'hash' => $encrypt_result['hash'],
        'e_key' => $encrypt_result['key']
    ]);
}

public static function encrypt(array $data, string $public_key): array
{
    //This is where the code fails
    openssl_seal(json_encode($data), $encrypted, $e_keys, [base64_decode($public_key)]);

    return [
        'hash' => base64_encode($encrypted),
        'key' => base64_encode($e_keys[0])
    ];
}

I have previously seen questions that attribute this to an error with XAMPP, and I was using XAMPP on Windows though have subsequently replaced it with Wampserver and the issue persists.

While using Linux on this project fulltime is not viable, I will be testing it later.

Is there anything simple I might be overlooking?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The problem seems to be a Windows problem. Since you said it would run on Linux, I would move the application into a Linux docker container. You can containerize existing Laravel projects in a few steps. With Laravel Sail. The documentation explains it very well: https://laravel.com/docs/8.x/sail.

If there is no Sail in your composer.json, add it to composer require laravel/sail --dev.

But if you are familiar with docker-compose then just use docker plain without Laravel Sail.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda