Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] Pusher 6.x+ does not support TLS options anymore #39920

Closed
wants to merge 1 commit into from

Conversation

rennokki
Copy link
Contributor

@rennokki rennokki commented Dec 7, 2021

The problem

Pusher 6.x+ swapped their support from CURLOPT to Guzzle, and removed the TLS options, and this brought a series of issues for TLS users that use self-signed certs in servers like Laravel WebSockets and soketi, locally or in private networks.

Potential fixes

There may be an approach to fix this by overwriting the BroadcastManager class at bootstrapping, but I had to find a way to overcome this by solving it at the root so that it isn't required.

Along the way, pre-6.x Pusher support has to be deprecated, and this might lead to issues in 8.x and should be in 9.x, but at the same time, it should be seen as a fix to support the new Pusher version's client argument.

This PR initializes Pusher with a Guzzle client whose options are defined in config/broadcasting.php. curl_options are no longer used, so in case it's defined, it should be removed:

'pusher' => [
    'driver' => 'pusher',
    'key' => env('PUSHER_APP_KEY', 'app-key'),
    'secret' => env('PUSHER_APP_SECRET', 'app-secret'),
    'app_id' => env('PUSHER_APP_ID', 'app-id'),
    'options' => [
        // ...
    ],
    'client_options' => [
        // You can pass request options: https://docs.guzzlephp.org/en/stable/request-options.html
        'verify' => false, // to disable TLS checks
    ],
],

Added support for client in Pusher instance
@francoism90
Copy link

@rennokki Many thanks!

This is really helpful and needed to allow self-signed certificates on local/non-production environments. Even on LAN, you may need to use SSL/TLS, including testing.

@GrahamCampbell GrahamCampbell changed the title [8.x/9.x?] Pusher 6.x+ does not support TLS options anymore [8.x] Pusher 6.x+ does not support TLS options anymore Dec 7, 2021
@GrahamCampbell
Copy link
Member

GrahamCampbell commented Dec 7, 2021

I don't think it makes sense to make this change in Laravel 8. Dropping old versions of the pusher sdk is a major breaking change because of the way it cannot be enforced easily.

@GrahamCampbell
Copy link
Member

I'd honestly recommend just not using self-signed stuff. There are ways around this, even for local dev.

@francoism90
Copy link

@GrahamCampbell I do understand this is not a support forum, but how should this work for things like this?

@rennokki
Copy link
Contributor Author

rennokki commented Dec 7, 2021

@GrahamCampbell At least would make sense to find a way to be able to initialize the custom Guzzle client passed to the Pusher instance for custom Guzzle options. :)

@taylorotwell
Copy link
Member

This will need to go to Laravel 9 (master branch).

@rennokki rennokki deleted the fix/pusher-tls branch December 8, 2021 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants