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

Use secure redis connection if config is set to use TLS #135

Closed pyr0hu closed 4 months ago

pyr0hu commented 4 months ago

When using secure Redis connections with TLS, Reverb will only construct a TCP connection and could not re-use the existing TLS connection.

rediss:// is the secure scheme when using TLS (See: https://www.iana.org/assignments/uri-schemes/prov/redis and also clue/reactphp-redis repository)

This PR checks if the Redis connection has a scheme option with tls as value (as per Laravel's documentation) and add's the s to the connection URL.

PS: the $protocol variable name might not be the best choice so I'm open for suggestions on that.