laravel / reverb

Laravel Reverb provides a real-time WebSocket communication backend for Laravel applications.
https://reverb.laravel.com
MIT License
1.05k stars 77 forks source link

Pusher error: cURL error 28: SSL connection timeout on send BroadcastMessage #86

Closed lsdevelop closed 6 months ago

lsdevelop commented 6 months ago

Reverb Version

1.0.0-beta2

Laravel Version

11.0

PHP Version

8.3

Description

I`m using Laravel Herd with SSL, the connection from client is working, but after update to laravel 11 and reverb (to laravel websockets) server dispatch events returns this:

Illuminate\Broadcasting\BroadcastException: Pusher error: cURL error 28: SSL connection timeout (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://chatbot.test:8080/apps/1001/events?auth_key=laravel-herd&auth_timestamp=1710421780&auth_version=1.0&body_md5=ab56f5161458b3dd0bd6c2564b449cc7&auth_signature=fd8da35337c12f08b01a15104940b53393adc23477033ec3f659dea66d1f67ad. in /Users/lucassantos/PhpstormProjects/chatbot/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php:164

My settings:

Herd: PHP Redis server, Real-Time reverb server Laravel Horizon

composer: "require": { "php": "^8.2.0", "aws/aws-sdk-php": "^3.256", "inertiajs/inertia-laravel": "^1.0", "laravel/framework": "^11.0", "laravel/horizon": "^5.23.1", "laravel/jetstream": "^5.0", "laravel/reverb": "@beta", "laravel/sanctum": "^4.0", "laravel/tinker": "^2.9.0", "league/flysystem-aws-s3-v3": "^3.24.0", "maatwebsite/excel": "^3.1", "opcodesio/log-viewer": "^v3.5.0", "pusher/pusher-php-server": "7.2.3", "tightenco/ziggy": "^2.0.4" }, "require-dev": { "fakerphp/faker": "^1.23.1", "lucascudo/laravel-pt-br-localization": "^v2.1.2", "mockery/mockery": "^1.6.9", "nunomaduro/collision": "^8.1", "phpunit/phpunit": "^10.5.11", "spatie/laravel-ignition": "^2.4.2" },

.env: REVERB_APP_ID=1001 REVERB_APP_KEY=laravel-herd REVERB_APP_SECRET=secret REVERB_HOST=chatbot.test REVERB_PORT=8080 REVERB_SCHEME=https

config: 'reverb' => [ 'host' => env('REVERB_SERVER_HOST', '0.0.0.0'), 'port' => env('REVERB_SERVER_PORT', 8080), 'hostname' => env('REVERB_HOST'), 'options' => [ 'tls' => [], ], 'scaling' => [ 'enabled' => env('REVERB_SCALING_ENABLED', false), 'channel' => env('REVERB_SCALING_CHANNEL', 'reverb'), ], 'pulse_ingest_interval' => env('REVERB_PULSE_INGEST_INTERVAL', 15), ],

broadcast message: `<?php

namespace App\Notifications;

use App\Enums\GlobalNotificationType; use App\Helpers\Disk; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\BroadcastMessage; use Illuminate\Notifications\Notification;

class ExportCompletedNotification extends Notification implements ShouldQueue { use Queueable;

public function __construct(public string $path, public string $fileType)
{
    //
}

public function via($notifiable): array
{
    return ['database', 'broadcast'];
}

public function toBroadcast($notifiable): BroadcastMessage
{
    return new BroadcastMessage([
        'data' => [...],
    ]);
}

}`

ps: This system working in production with Laravel Websockets

Steps To Reproduce

  1. install herd with reverb and redis servers
  2. install laravel horizon
  3. enable server custom dns "laravel.test"
  4. enable server ssl
  5. create broadcast message
  6. dispatch notification message
  7. check laravel horizon fail logs
lsdevelop commented 6 months ago

Please close, this issure is simillary to #78