0

Having issues getting secure websockets to work in laravel on AWS elastic beanstalk.

They work fine in dev and production over http & ws.

In dev it works fine over https and wss.

In production (with all the same settings, just different certs) over https and wss i'm getting the following error

failed: Error in connection establishment: net::ERR_CONNECTION_CLOSED

Assuming a problem with the certificate or key, I've tried changing to an incorrect cert & key. Then the error changes to the following.

failed: Error in connection establishment: net::ERR_SSL_VERSION_OR_CIPHER_MISMATCH

So i'm assuming that the certificate isn't the issue.

Config as below: websockets.php

'apps' => [
    [
        'id' => env('PUSHER_APP_ID'),
        'name' => env('APP_NAME'),
        'key' => env('PUSHER_APP_KEY'),
        'secret' => env('PUSHER_APP_SECRET'),
        'path' => env('PUSHER_APP_PATH'),
        'capacity' => null,
        'enable_client_messages' => true,
        'enable_statistics' => true,
    ],
],
'ssl' => [
    /*
     * Path to local certificate file on filesystem. It must be a PEM encoded file which
     * contains your certificate and private key. It can optionally contain the
     * certificate chain of issuers. The private key also may be contained
     * in a separate file specified by local_pk.
     */
    'local_cert' => env('LARAVEL_WEBSOCKETS_SSL_LOCAL_CERT', null),

    /*
     * Path to local private key file on filesystem in case of separate files for
     * certificate (local_cert) and private key.
     */
    'local_pk' => env('LARAVEL_WEBSOCKETS_SSL_LOCAL_PK', null),

    /*
     * Passphrase for your local_cert file.
     */
    'passphrase' => env('LARAVEL_WEBSOCKETS_SSL_PASSPHRASE', null),


    'verify_peer' => false,
],

.env file

LARAVEL_WEBSOCKETS_SSL_LOCAL_CERT=/etc/pki/tls/certs/cert.cer
LARAVEL_WEBSOCKETS_SSL_LOCAL_PK=/etc/pki/tls/certs/server.key
Ryk Waters
  • 657
  • 3
  • 8
  • 22

1 Answers1

0

Please add a Passphrase to your Cert-File and to env('LARAVEL_WEBSOCKETS_SSL_PASSPHRASE', null).

I had same issues with Keystores without Password.

TimeO84
  • 332
  • 1
  • 11