You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: apply TLS and auth config to Redis Sentinel connections (#1015)
* fix: apply TLS and auth config to Redis Sentinel connections
When using Redis Sentinel with TLS enabled, the client was failing
to connect to Sentinel nodes because the TLS configuration was not
being applied to the SentinelConnFunc. This caused "SSL wrong version
number" errors and connection resets.
This fix adds a sentinelDialFunc that properly applies:
- TLS configuration (when REDIS_TLS=true)
- Authentication settings (when REDIS_AUTH is set)
- Connection timeout settings
The fix mirrors the approach used for the main Redis connection
dial function, ensuring consistent configuration across both
Sentinel and data node connections.
Fixes connection to Redis Sentinel over TLS.
Signed-off-by: Stefan Kolesnikowicz <stefan@sandnetworks.com>
Signed-off-by: stekole <stefan@sandnetworks.com>
* fix: apply TLS and auth config to Redis Sentinel connections
When using Redis Sentinel with TLS enabled, the client was failing
to connect to Sentinel nodes because the TLS configuration was not
being applied to the SentinelConnFunc. This caused "SSL wrong version
number" errors and connection resets.
This fix adds a sentinelDialFunc that properly applies:
- TLS configuration (when REDIS_TLS=true)
- Authentication settings (when REDIS_AUTH is set)
- Connection timeout settings
The fix mirrors the approach used for the main Redis connection
dial function, ensuring consistent configuration across both
Sentinel and data node connections.
Fixes connection to Redis Sentinel over TLS.
Signed-off-by: Stefan Kolesnikowicz <stefan@sandnetworks.com>
Signed-off-by: stekole <stefan@sandnetworks.com>
* fix: apply TLS and auth config to Redis Sentinel connections
When using Redis Sentinel with TLS enabled, the client was failing
to connect to Sentinel nodes because the TLS configuration was not
being applied to the SentinelConnFunc. This caused "SSL wrong version
number" errors and connection resets.
This fix adds a sentinelDialFunc that properly applies:
- TLS configuration (when REDIS_TLS=true)
- Authentication settings (when REDIS_AUTH is set)
- Connection timeout settings
The fix mirrors the approach used for the main Redis connection
dial function, ensuring consistent configuration across both
Sentinel and data node connections.
Fixes connection to Redis Sentinel over TLS.
Signed-off-by: Stefan Kolesnikowicz <stefan@sandnetworks.com>
Signed-off-by: stekole <stefan@sandnetworks.com>
---------
Signed-off-by: Stefan Kolesnikowicz <stefan@sandnetworks.com>
Signed-off-by: stekole <stefan@sandnetworks.com>
Copy file name to clipboardExpand all lines: README.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1253,8 +1253,9 @@ As well Ratelimit supports TLS connections and authentication. These can be conf
1253
1253
1.`REDIS_TLS` & `REDIS_PERSECOND_TLS`: set to `"true"` to enable a TLS connection for the specific connection type.
1254
1254
1.`REDIS_TLS_CLIENT_CERT`, `REDIS_TLS_CLIENT_KEY`, and `REDIS_TLS_CACERT` to provides files to specify a TLS connection configuration to Redis server that requires client certificate verification. (This is effective when `REDIS_TLS` or `REDIS_PERSECOND_TLS` is set to to `"true"`).
1255
1255
1.`REDIS_TLS_SKIP_HOSTNAME_VERIFICATION` set to `"true"` will skip hostname verification in environments where the certificate has an invalid hostname, such as GCP Memorystore.
1256
-
1.`REDIS_AUTH` & `REDIS_PERSECOND_AUTH`: set to `"password"` to enable password-only authentication to the redis host.
1257
-
1.`REDIS_AUTH` & `REDIS_PERSECOND_AUTH`: set to `"username:password"` to enable username-password authentication to the redis host.
1256
+
1.`REDIS_AUTH` & `REDIS_PERSECOND_AUTH`: set to `"password"` to enable password-only authentication to the Redis master/replica nodes.
1257
+
1.`REDIS_AUTH` & `REDIS_PERSECOND_AUTH`: set to `"username:password"` to enable username-password authentication to the Redis master/replica nodes.
1258
+
1.`REDIS_SENTINEL_AUTH` & `REDIS_PERSECOND_SENTINEL_AUTH`: set to `"password"` or `"username:password"` to enable authentication to Redis Sentinel nodes. This is separate from `REDIS_AUTH`/`REDIS_PERSECOND_AUTH` which authenticate to the Redis master/replica nodes. Only used when `REDIS_TYPE` or `REDIS_PERSECOND_TYPE` is set to `"sentinel"`. If not set, no authentication will be attempted when connecting to Sentinel nodes.
1258
1259
1.`CACHE_KEY_PREFIX`: a string to prepend to all cache keys
1259
1260
1260
1261
For controlling the behavior of cache key incrementation when any of them is already over the limit, you can use the following configuration:
0 commit comments