docs icon indicating copy to clipboard operation
docs copied to clipboard

SSL disable verify host

Open benben001x opened this issue 2 years ago • 3 comments

how to set SSL disable verify host in config

benben001x avatar May 26 '23 06:05 benben001x

pusher/pusher-php-server v6 switched from directly using CURL to Guzzle . a4f08c0

Option 1 - Use GuzzleHttp client options

  'connections' => [
      // ...
      'pusher' => [
          // ...
-         'curl_options' => [
-             CURLOPT_SSL_VERIFYHOST => 0,
-             CURLOPT_SSL_VERIFYPEER => 0,
-         ],
+         'client_options' => [
+             'verify' => false,
+         ],
      ],
  ],

Option 2 - Use a customer GuzzleHttp client

app/Http/Providers/AppServiceProvider.php

public function boot(): void
{
    app(BroadcastManager::class)->extend('pusher-custom', function () {
        $pusher = new Pusher(
            config('broadcasting.connections.pusher.key'),
            config('broadcasting.connections.pusher.secret'),
            config('broadcasting.connections.pusher.app_id'),
            config('broadcasting.connections.pusher.options'),
            new \GuzzleHttp\Client(['verify' => false]),
        );

        return new PusherBroadcaster($pusher);
    });
}
  'connections' => [
+     'pusher-custom' => [
+         'driver' => 'pusher-custom'
+     ],
      'pusher' => [

Refs:

  • https://github.com/beyondcode/laravel-websockets/issues/879
  • https://github.com/pusher/pusher-http-php/issues/313
  • https://github.com/soketi/soketi/issues/191

mtvbrianking avatar Feb 07 '24 02:02 mtvbrianking

Don't forget to update .env from pusher to pusher-custom from BROADCAST_DRIVER=pusher to BROADCAST_DRIVER=pusher-custom

noobshow avatar Feb 16 '24 18:02 noobshow

https://www.cloudways.com/blog/comment-system-laravel-vuejs/

mtvbrianking avatar Feb 17 '24 01:02 mtvbrianking