Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

manshu's avatar
Level 28

Laravel Websockets Pusher error: cURL error 35: error

Hello Everyone, I've been having issues regarding Laravel Websockets.

Let me give you some context on my code. I am using Laravel Valet for local setup, but when I am trying to post anything, it gives me an error Pusher error: cURL error 35:

This is how my ```app.js```` file looks like

window.Echo = new Echo({
  broadcaster: 'pusher',
  key: process.env.MIX_PUSHER_APP_KEY,
  wsHost: process.env.MIX_PUSHER_APP_HOST,
  encrypted: true,
  wsPort: 6001,
  wssPort: 6001,
  disableStats: true,
  enabledTransports: ['ws', 'wss']
})

This is how my broadcasting.php file looks like.

'connections' => [

        'pusher' => [
            'driver' => 'pusher',
            'key' => env('PUSHER_APP_KEY'),
            'secret' => env('PUSHER_APP_SECRET'),
            'app_id' => env('PUSHER_APP_ID'),
            'options' => [
                'cluster' => env('PUSHER_APP_CLUSTER'),
                'encrypted' => true,
                'host' => '127.0.0.1',
                'port' => 6001,
                'scheme' => 'https',
                'curl_options' => [
                    CURLOPT_SSL_VERIFYHOST => 0,
                    CURLOPT_SSL_VERIFYPEER => 0,
                ],
            ],
        ],
Illuminate\Broadcasting\BroadcastException
Pusher error: cURL error 35: error:0407008A:rsa routines:RSA_padding_check_PKCS1_type_1:invalid padding (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://127.0.0.1:6001/apps/local/events?auth_key=local&auth_timestamp=1651145851&auth_version=1.0&body_md5=8ceeb6d337c0a5620b6eff137c370edb&auth_signature=74d7c6353ada4819121e30d45ec7d9e283481d38d1f30c0f97d93697f1dc7df8.
0 likes
15 replies
manshu's avatar
Level 28

I am using lets encrypt in prod, and it has same error pusher error 60 for ssl as well

sr57's avatar

right ssl config in config/websockets.php ?

any chance that you ssl certifcate get corrupted?

manshu's avatar
Level 28

@sr57 nope, it doesn’t look like it. Otherwise prod error wouldn’t be the same

manshu's avatar
Level 28

@sr57 not really, im just playing around with Laravel Websockets package.

manshu's avatar
Level 28

Bumping this to see, if anyone has idea about this?

manshu's avatar
Level 28

Update: Here is the error on my production server for the same issue.

production.ERROR: cURL error 60: SSL: no alternative certificate subject name matches target host name '127.0.0.1'
manshu's avatar
Level 28

Bumping, as im still stuck with this error.

neoteknic's avatar

@manshu Go here : /etc/ssl (or anywhere)

Download the cacert file :

cd /etc/ssl
wget https : // curl.haxx.se/ca/cacert.pem

(! remove space cant include links)

put it in php config CLI if using queue/horizon (processed by horizon, you can add it to php-fpm config too) (search cainfo in file ) :

[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
curl.cainfo =/etc/ssl/cacert.pem

veryfy your pusher host :

PUSHER_HOST=127.0.0.1 # NOO dont use that !

just use any domain on your server, not 127.0.0.1

PUSHER_HOST=mydomain.com

It should work now !

neoteknic's avatar

add 'verify_peer' => false in config/websockets.php 'ssl'=> without this it work, but not in chrome private mode, dont know why

manshu's avatar
manshu
OP
Best Answer
Level 28

I switched to Soketi/soketi library instead. Thanks everyone for the help, but Laravel Websockets package didn’t work for me in local environment.

Hydra74's avatar

I have set in file vendor/guzzlehttp/guzzle/src/Client.php in defaults array "verify" => false.

$defaults = [
    'allow_redirects' => RedirectMiddleware::$defaultSettings,
    'http_errors'     => true,
    'decode_content'  => true,
    'verify'          => false,
    'cookies'         => false,
    'idn_conversion'  => false,
];

This remove the error : cURL error 60: SSL: no alternative certificate subject name matches target host name '127.0.0.1' in local environment

Bvanhaastrecht's avatar

I get this exact same error after upgrading from Laravel 8 to 9. With this upgrade pusher is upgraded to 7.2.0. From pusher 6.0.0 they removed the curl_options. So the CURLOPT_SSL_VERIFYPEER no longer works and so you will get this SSL error.

Check the discussion about this here: https://github.com/pusher/pusher-http-php/issues/313

I'm determining what I will do to solve this.

Please or to participate in this conversation.