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

cyberduck's avatar

Laravel WebSockets: Illuminate \ Broadcasting \ BroadcastException: No Message and net::ERR_CERT_AUTHORITY_INVALID

I've been trying to get this WebSocket package running on my local Laravel project for about a week now and I can't seem to find a solution to the issue. I've followed the documentation, multiple tutorials and answers on Stack Overflow / Github, but I keep getting the same error. These are my configurations:

.env:

PUSHER_APP_ID=anyId
PUSHER_APP_KEY=anyKey
PUSHER_APP_SECRET=anySecret
PUSHER_APP_CLUSTER=eu

config/broadcasting:

'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'),
        'useTLS' => true,
        'encrypted' => false,
        'host' => '127.0.0.1',
        'port' => 6001,
        'scheme' => 'http',
        'curl_options' => [
            CURLOPT_SSL_VERIFYHOST => 0,
            CURLOPT_SSL_VERIFYPEER => 0,
        ]
    ],
]

config/websockets:

'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' => false,
        'enable_statistics' => true,
    ],
],

resources/js/bootstrap.js: There is also WebsocketEvent and controller which calls the broadcasting of the event, I haven't included them to keep this shorter.

import Echo from 'laravel-echo'

window.Pusher = require('pusher-js');

window.Echo = new Echo({
    broadcaster: 'pusher',
    key: 'anyKey',
    encrypted: false,
    wsHost: window.location.hostname,
    wsPort: 6001,
    disableStats: true,
    enabledTransports: ['ws', 'wss']
});

window.Echo.channel('DemoChannel')
    .listen('WebsocketEvent', (e) => {
       console.log(e);
    });

Front-end error: This only seems to be fine when I set enabledTransports: ['wss'] which represents the secure connection but default of enabledTransports: ['ws'] doesn't.

image

Back-end error: Always fails.

image

As you can see, I've added the curl options as recommended on https://github.com/beyondcode/laravel-websockets/issues/109 and I've set encrypted: false. Overall, I believe it is a certificate issue which is beyond my full comprehension but the tutorials I followed seem to get it working perfectly on their local environment without SSL certificates, etc. Also, it seems like other developers who are having similar issues are not getting answered (example), which is why I am posting this. Any help would be appreciated, thank you.

0 likes
2 replies
cyberduck's avatar

That port is for the applications that are using SSL so mainly the projects that are already deployed to the server. I've tried it though and I still get the same error. I've been stuck on it for a while, I'm just not sure who to contact specifically.

Please or to participate in this conversation.