laravel / reverb

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

[1.x] Fixes SSL connection issues in Chrome / Arc #159

Closed joedixon closed 4 months ago

joedixon commented 4 months ago

When used with secure sites on Valet or Herd, Reverb will automatically discover the certificate and use it to enable secure WebSocket connections.

This works nicely, but there are issues in Chrome.

If you use Echo to connect over wss, Chrome will reject the connection without any useful reason why.

What's even more strange is if you navigate to https://site.test:8080 in the browser, Reverb will load the page with no SSL error.

After doing so, attempting to connect via Echo again (wss://site.test:8080), results in a successful connection 🤷

I was able to go deep into Chrome and review the logs which exposed an error: ERR_SSL_CLIENT_AUTH_CERT_NEEDED

This indicates an issue in the SSL handshake between client and server. The server doesn't trust the certificate being used by the client - strange because it works fine over https.

By disabling peer verification, the handshake completes successfully.

I still believe this to be an issue with the browser, but this does resolve the issue and I don't really see an issue with disabling verify_peer in local development.