reverb: Using ssl in valet environment causes error.

Reverb Version

1.0.0-beta7

Laravel Version

11.4.0

PHP Version

8.2.16

Description

I have struggled to get laravel reverb work locally with valet & ssl & Livewire.

I can get Echo successfully connet to reverb, but when dispatching event, I get error:

[2024-04-19 10:17:12] local.ERROR: cURL error 56: OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 0

Steps To Reproduce

I use node version 20.10. Valet version: 4.6.1

composer create-project laravel/laravel reverb-app
cd reverb-app
valet link --secure
composer require laravel/breeze --dev
php artisan breeze:install
   -> Livewire (Volt Class API) with Alpine -> No -> phpunit
php artisan install:broadcasting
  -> Yes, install reverb...
  -> Would you like to install and build the Node dependencies required for broadcasting? Yes.

Change from .env: APP_URL=https://reverb-app.test REVERB_HOST=“reverb-app.test” REVERB_SCHEME=https

Set reverb.cong tls option to:

'tls' => [
   'verify_peer' => false,
   'allow_self_signed' => true,
],

Create TestEvent for broadcasting: php artisan make:event TestEvent Edit TestEvet to implement ShouldBroadcast and chane PrivateChannel to Channel

Start parallel: npm run dev php artisan reverb:start --debug php artisan queue:work

Check browser connects successfully and reverb debug shows connection.

Dispatch event from tinker: App\Events\TestEvent::dispatch();

See error from logs: [2024-04-19 10:48:14] local.ERROR: cURL error 56: OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 0

Full trace [2024-04-19 10:48:14] local.ERROR: cURL error 56: OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 0 (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://reverb-app.test:8080/apps/835917/events?auth_key=bkefoajmyavya3ph3lml&auth_timestamp=1713523694&auth_version=1.0&body_md5=290a36791f069f26dc79082e40601c21&auth_signature=ff9d675c3f35a20b31e8dc9d106d3d6dd8f9208749641316f0be6c9aca044b8f {"exception":"[object] (GuzzleHttp\\Exception\\RequestException(code: 0): cURL error 56: OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 0 (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://reverb-app.test:8080/apps/835917/events?auth_key=bkefoajmyavya3ph3lml&auth_timestamp=1713523694&auth_version=1.0&body_md5=290a36791f069f26dc79082e40601c21&auth_signature=ff9d675c3f35a20b31e8dc9d106d3d6dd8f9208749641316f0be6c9aca044b8f at /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:211) [stacktrace] #0 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(158): GuzzleHttp\\Handler\\CurlFactory::createRejection(Object(GuzzleHttp\\Handler\\EasyHandle), Array) #1 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(110): GuzzleHttp\\Handler\\CurlFactory::finishError(Object(GuzzleHttp\\Handler\\CurlHandler), Object(GuzzleHttp\\Handler\\EasyHandle), Object(GuzzleHttp\\Handler\\CurlFactory)) #2 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(47): GuzzleHttp\\Handler\\CurlFactory::finish(Object(GuzzleHttp\\Handler\\CurlHandler), Object(GuzzleHttp\\Handler\\EasyHandle), Object(GuzzleHttp\\Handler\\CurlFactory)) #3 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(28): GuzzleHttp\\Handler\\CurlHandler->__invoke(Object(GuzzleHttp\\Psr7\\Request), Array) #4 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(48): GuzzleHttp\\Handler\\Proxy::GuzzleHttp\\Handler\\{closure}(Object(GuzzleHttp\\Psr7\\Request), Array) #5 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php(64): GuzzleHttp\\Handler\\Proxy::GuzzleHttp\\Handler\\{closure}(Object(GuzzleHttp\\Psr7\\Request), Array) #6 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/Middleware.php(31): GuzzleHttp\\PrepareBodyMiddleware->__invoke(Object(GuzzleHttp\\Psr7\\Request), Array) #7 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php(71): GuzzleHttp\\Middleware::GuzzleHttp\\{closure}(Object(GuzzleHttp\\Psr7\\Request), Array) #8 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/Middleware.php(63): GuzzleHttp\\RedirectMiddleware->__invoke(Object(GuzzleHttp\\Psr7\\Request), Array) #9 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/HandlerStack.php(75): GuzzleHttp\\Middleware::GuzzleHttp\\{closure}(Object(GuzzleHttp\\Psr7\\Request), Array) #10 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/Client.php(333): GuzzleHttp\\HandlerStack->__invoke(Object(GuzzleHttp\\Psr7\\Request), Array) #11 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/Client.php(169): GuzzleHttp\\Client->transfer(Object(GuzzleHttp\\Psr7\\Request), Array) #12 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/Client.php(189): GuzzleHttp\\Client->requestAsync('POST', Object(GuzzleHttp\\Psr7\\Uri), Array) #13 /Users/juser/code/reverb-app/vendor/guzzlehttp/guzzle/src/ClientTrait.php(95): GuzzleHttp\\Client->request('POST', 'apps/835917/eve...', Array) #14 /Users/juser/code/reverb-app/vendor/pusher/pusher-php-server/src/Pusher.php(776): GuzzleHttp\\Client->post('apps/835917/eve...', Array) #15 /Users/juser/code/reverb-app/vendor/pusher/pusher-php-server/src/Pusher.php(441): Pusher\\Pusher->post('/apps/835917/ev...', '{\"name\":\"App\\\\\\\\E...') #16 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php(161): Pusher\\Pusher->trigger(Array, 'App\\\\Events\\\\Test...', Array, Array) #17 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php(237): Illuminate\\Broadcasting\\Broadcasters\\PusherBroadcaster->Illuminate\\Broadcasting\\Broadcasters\\{closure}(Object(Illuminate\\Support\\Collection), 0) #18 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php(160): Illuminate\\Support\\Collection->each(Object(Closure)) #19 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastEvent.php(92): Illuminate\\Broadcasting\\Broadcasters\\PusherBroadcaster->broadcast(Object(Illuminate\\Support\\Collection), 'App\\\\Events\\\\Test...', Array) #20 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\\Broadcasting\\BroadcastEvent->handle(Object(Illuminate\\Broadcasting\\BroadcastManager)) #21 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}() #22 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure)) #23 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure)) #24 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL) #25 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(128): Illuminate\\Container\\Container->call(Array) #26 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}(Object(Illuminate\\Broadcasting\\BroadcastEvent)) #27 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Broadcasting\\BroadcastEvent)) #28 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(132): Illuminate\\Pipeline\\Pipeline->then(Object(Closure)) #29 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(124): Illuminate\\Bus\\Dispatcher->dispatchNow(Object(Illuminate\\Broadcasting\\BroadcastEvent), false) #30 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Queue\\CallQueuedHandler->Illuminate\\Queue\\{closure}(Object(Illuminate\\Broadcasting\\BroadcastEvent)) #31 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Broadcasting\\BroadcastEvent)) #32 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(123): Illuminate\\Pipeline\\Pipeline->then(Object(Closure)) #33 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(71): Illuminate\\Queue\\CallQueuedHandler->dispatchThroughMiddleware(Object(Illuminate\\Queue\\Jobs\\DatabaseJob), Object(Illuminate\\Broadcasting\\BroadcastEvent)) #34 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(102): Illuminate\\Queue\\CallQueuedHandler->call(Object(Illuminate\\Queue\\Jobs\\DatabaseJob), Array) #35 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(439): Illuminate\\Queue\\Jobs\\Job->fire() #36 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(389): Illuminate\\Queue\\Worker->process('database', Object(Illuminate\\Queue\\Jobs\\DatabaseJob), Object(Illuminate\\Queue\\WorkerOptions)) #37 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(176): Illuminate\\Queue\\Worker->runJob(Object(Illuminate\\Queue\\Jobs\\DatabaseJob), 'database', Object(Illuminate\\Queue\\WorkerOptions)) #38 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(139): Illuminate\\Queue\\Worker->daemon('database', 'default', Object(Illuminate\\Queue\\WorkerOptions)) #39 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(122): Illuminate\\Queue\\Console\\WorkCommand->runWorker('database', 'default') #40 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\\Queue\\Console\\WorkCommand->handle() #41 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}() #42 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure)) #43 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure)) #44 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL) #45 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Console/Command.php(212): Illuminate\\Container\\Container->call(Array) #46 /Users/juser/code/reverb-app/vendor/symfony/console/Command/Command.php(279): Illuminate\\Console\\Command->execute(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle)) #47 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Console/Command.php(181): Symfony\\Component\\Console\\Command\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle)) #48 /Users/juser/code/reverb-app/vendor/symfony/console/Application.php(1049): Illuminate\\Console\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput)) #49 /Users/juser/code/reverb-app/vendor/symfony/console/Application.php(318): Symfony\\Component\\Console\\Application->doRunCommand(Object(Illuminate\\Queue\\Console\\WorkCommand), Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput)) #50 /Users/juser/code/reverb-app/vendor/symfony/console/Application.php(169): Symfony\\Component\\Console\\Application->doRun(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput)) #51 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(196): Symfony\\Component\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput)) #52 /Users/juser/code/reverb-app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1183): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput)) #53 /Users/juser/code/reverb-app/artisan(13): Illuminate\\Foundation\\Application->handleCommand(Object(Symfony\\Component\\Console\\Input\\ArgvInput)) #54 {main} "}

About this issue

  • Original URL
  • State: closed
  • Created 2 months ago
  • Comments: 25 (11 by maintainers)

Most upvoted comments

I want to do a little more testing, but assuming all goes well, I think it’s likely we can get a new release out pretty soon.

Thanks @jksa - I went deeper into the rabbit hole today and think I came out with a solution.

Would you be able to give this PR a test: #167

@joedixon I’m more than happy to confirm that PR seem to fix my issue!!! Now dispatching events via work queue runs with out errors and browser receives events! Excellent!!! Thanks a lot for you efforts! Any ideas when this would be released?

Thanks @jksa - I went deeper into the rabbit hole today and think I came out with a solution.

Would you be able to give this PR a test: https://github.com/laravel/reverb/pull/167

@bretterer the Reverb Herd service is separate and doesn’t yet have TLS support.

Are you trying to use that or do you have Reverb installed in your application?

@bretterer I have just tested your repo - you need to update your environment variables as follows:

REVERB_APP_ID=147395
REVERB_APP_KEY=e0bgxgxlni4u4wntyj2k
REVERB_APP_SECRET=vn7tuvmso5cmmlvz7uwg
- REVERB_HOST="localhost"
+ REVERB_HOST="reverb-ssl-test.test"
REVERB_PORT=8080
- REVERB_SCHEME=http

Using the correct hostname and removing the plaintext scheme which will use the https default instead should resolve your issue.

@jksa I’m a Herd user so going to take me a little longer to test on Valet.