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
Can't stablish ssl connection with soketi and laravel #1106
Comments
Potential solutionThe solution involves ensuring that the SSL configuration is correctly set up across various components of the system, including the nginx server, the soketi server, and the Laravel and React Native applications. The SSL certificates must be correctly referenced, and the environment variables must be properly configured to match the SSL setup. What is causing this bug?The bug is likely caused by a misconfiguration in the SSL setup, which could be due to incorrect paths to SSL certificates, incorrect environment variable settings, or a mismatch in the SSL configuration between the nginx server, soketi server, and the applications. Additionally, the use of different schemes ( CodeTo solve the bug, the following changes and verifications should be made:
How to replicate the bugTo replicate the bug, attempt to establish an SSL connection from the React Native app to the Laravel app using soketi with the provided configurations. The connection will fail, and the logs will show an "unavailable" state due to the SSL misconfiguration. TaskTo resolve the issue, follow the steps outlined in the "Code" section above, ensuring that all configurations are consistent and correct for SSL communication. After making the necessary changes, restart the nginx and soketi services, and test the connection from the React Native app again. Click here to create a Pull Request with the proposed solution Files used for this task: Changes on /etc/nginx/sites-available/laraapp.comAs the source code for However, based on the user's provided information in the ticket description, here are some general points that should be checked in the actual nginx configuration file:
Since the actual nginx configuration is not available in the provided source code, I recommend the user to check these points in their nginx configuration file to ensure that SSL is correctly set up for their domain and that WebSocket connections are properly proxied to the soketi server. If the user continues to experience issues, they should provide the actual nginx configuration for further analysis. Changes on /etc/supervisor/conf.d/soketi.confThe provided source code for To resolve the issue, the user needs to ensure that the The user's ticket description provides an example of what the configuration should look like, including the environment variables for the SSL certificate and key. The user should verify that the actual configuration file on the server matches this example and that the paths to the SSL certificate and key are correct and accessible by the soketi process. If the configuration is indeed missing from the file, the user should add the necessary configuration as per the example provided in the ticket description. After updating the configuration, the user should reload the Supervisor configuration and restart the soketi service to apply the changes. In summary, the issue with this file is that it is empty and does not contain the necessary configuration for running the soketi service with SSL. The user needs to add the correct configuration to this file and ensure that the SSL certificate and key paths are valid. Changes on React Native App Connection SetupAs the React Native App Connection Setup file is new and contains no actual source code, there is nothing to analyze or report regarding this file in relation to the SSL connection issue described in the ticket. The user should ensure that the connection setup in their React Native app is correctly implemented with the appropriate options for establishing an SSL connection. This includes setting 'wsHost' to the domain name that matches the SSL certificate, 'wsPort' and 'wssPort' to the correct port numbers (typically 443 for secure WebSocket connections), 'encrypted' to true, and 'forceTLS' to true if SSL is required. Since the file is empty, the user should add the necessary code to configure the Pusher client and Echo instance with the correct SSL options as described in the task plan. If the user has already written this code elsewhere, they should verify that it matches the requirements for a secure connection. In summary, there is no action to be taken on this file as it stands. The user should proceed to implement or verify the SSL connection setup in their React Native app according to the plan provided. Changes on /var/www/laraapp.com/config/broadcasting.phpThe provided source code for To resolve the issue, the user needs to populate the Here is an example of what the configuration might look like based on the information provided in the ticket: <?php
return [
'default' => env('BROADCAST_DRIVER', 'null'),
'connections' => [
'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' => true,
'host' => env('PUSHER_HOST'),
'port' => env('PUSHER_PORT'),
'scheme' => env('PUSHER_SCHEME'),
'curl_options' => [
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
],
],
],
// Other broadcast connections...
],
// Other configuration...
]; The user should ensure that the Changes on /var/www/laraapp.com/.envThe provided source code for the file Given the user's issue with establishing an SSL connection with Soketi and Laravel, the absence of environment variable definitions in the To resolve the issue, the
Please note that the actual values for the keys and secrets should be kept confidential and secure. The provided values here are placeholders based on the user's redacted information. Once the Disclaimer: This comment was entirely generated using AI. Be aware that the information provided may be incorrect. Current plan usage: 102.04% Have feedback or need help? |
Still unresolved |
I'm also working through some SSL issues. Make sure the certificate is valid. Also make sure that both servers can handle TLS. |
I want to connect my react native app to a laravel app I run on a DigitalOcean ubuntu machine along with soketi server but I can't connect for some reason:
My broadcasting.php file
My .env variables (changed credentials)
Then how I start echo on my react native app:
I setup a supervisor daemon to start soketi server (I point supervisor to SSL_CERT and SSL_KEY with soketi env variables:
And I also setup SSL certificates with certbot that I let nginx handle, my nginx conf looks like this:
On my frontend I receive console logs trying to connect but it says unnavailable...
And when I try to broadcast an event from my laravel production server I receive a blank Pusher error message:
CAN YOU GUYS HELP ME, i have been stuck like this for a while...
The text was updated successfully, but these errors were encountered: