-
Notifications
You must be signed in to change notification settings - Fork 69
Fix SSL parameter not extracted from rediss:// URL in SentinelConfig #277
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
Merged
+27
−2
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11f84ca to
370b7db
Compare
When passing a `rediss://` URL to SentinelConfig, the SSL setting was not being extracted from the URL scheme, causing SSL connections to fail silently. This was inconsistent with the regular Config class, which correctly extracts the SSL parameter. The issue was in the URL parsing logic where `ssl: url_config.ssl?` was missing from the client_config hash that's built from the URL. This commit adds the missing SSL extraction and includes a test to verify that rediss:// URLs properly enable SSL for master/replica connections while keeping Sentinel connections unaffected.
370b7db to
2549889
Compare
stanhu
added a commit
to stanhu/redis-client
that referenced
this pull request
Jan 8, 2026
PR redis-rb#277 fixed the issue where `ssl` was not set on the Redis client automatically if a `rediss://` URl were used: ```ruby require 'redis' config = { url: 'rediss://mymaster', sentinels: [ { host: 'localhost', port: 26379, ssl: true } , { host: 'localhost', port: 26381, ssl: true }, { host: 'localhost', port: 26380, ssl: true } ] } client = Redis.new(config) ```` However, it broke the case if you explicitly set `ssl` and expected for it to propagate: ```ruby require 'redis' config = { name: 'mymaster', ssl: true, sentinels: [ { host: 'localhost', port: 26379 }, { host: 'localhost', port: 26381 }, { host: 'localhost', port: 26380 } ] } client = Redis.new(config) ```` Closes redis-rb#279
stanhu
added a commit
to stanhu/redis-client
that referenced
this pull request
Jan 8, 2026
PR redis-rb#277 fixed the issue where `ssl` was not set on the Redis client automatically if a `rediss://` URl were used: ```ruby require 'redis' config = { url: 'rediss://mymaster', sentinels: [ { host: 'localhost', port: 26379, ssl: true } , { host: 'localhost', port: 26381, ssl: true }, { host: 'localhost', port: 26380, ssl: true } ] } client = Redis.new(config) ```` However, it broke the case if you explicitly set `ssl` and expected it to propagate: ```ruby require 'redis' config = { name: 'mymaster', ssl: true, sentinels: [ { host: 'localhost', port: 26379 }, { host: 'localhost', port: 26381 }, { host: 'localhost', port: 26380 } ] } client = Redis.new(config) ```` Closes redis-rb#279
stanhu
added a commit
to stanhu/redis-client
that referenced
this pull request
Jan 8, 2026
PR redis-rb#277 fixed the issue where `ssl` was not set on the Redis client automatically if a `rediss://` URl were used: ```ruby require 'redis' config = { url: 'rediss://mymaster', sentinels: [ { host: 'localhost', port: 26379, ssl: true } , { host: 'localhost', port: 26381, ssl: true }, { host: 'localhost', port: 26380, ssl: true } ] } client = Redis.new(config) ```` However, it broke the case if you explicitly set `ssl` and expected it to propagate: ```ruby require 'redis' config = { name: 'mymaster', ssl: true, sentinels: [ { host: 'localhost', port: 26379 }, { host: 'localhost', port: 26381 }, { host: 'localhost', port: 26380 } ] } client = Redis.new(config) ```` Closes redis-rb#279
stanhu
added a commit
to stanhu/redis-client
that referenced
this pull request
Jan 8, 2026
PR redis-rb#277 fixed the issue where `ssl` was not set on the Redis client automatically if a `rediss://` URl were used: ```ruby require 'redis' config = { url: 'rediss://mymaster', sentinels: [ { host: 'localhost', port: 26379, ssl: true } , { host: 'localhost', port: 26381, ssl: true }, { host: 'localhost', port: 26380, ssl: true } ] } client = Redis.new(config) ```` However, it broke the case if you explicitly set `ssl` and expected it to propagate: ```ruby require 'redis' config = { name: 'mymaster', ssl: true, sentinels: [ { host: 'localhost', port: 26379 }, { host: 'localhost', port: 26381 }, { host: 'localhost', port: 26380 } ] } client = Redis.new(config) ```` Closes redis-rb#279
stanhu
added a commit
to stanhu/redis-client
that referenced
this pull request
Jan 8, 2026
PR redis-rb#277 fixed the issue where `ssl` was not set on the Redis client automatically if a `rediss://` URl were used: ```ruby require 'redis' config = { url: 'rediss://mymaster', sentinels: [ { host: 'localhost', port: 26379, ssl: true } , { host: 'localhost', port: 26381, ssl: true }, { host: 'localhost', port: 26380, ssl: true } ] } client = Redis.new(config) ```` However, it broke the case if you explicitly set `ssl` and expected it to propagate: ```ruby require 'redis' config = { name: 'mymaster', ssl: true, sentinels: [ { host: 'localhost', port: 26379 }, { host: 'localhost', port: 26381 }, { host: 'localhost', port: 26380 } ] } client = Redis.new(config) ```` Closes redis-rb#279
stanhu
added a commit
to stanhu/redis-client
that referenced
this pull request
Jan 8, 2026
PR redis-rb#277 fixed the issue where `ssl` was not set on the Redis client automatically if a `rediss://` URl were used: ```ruby require 'redis' config = { url: 'rediss://mymaster', sentinels: [ { host: 'localhost', port: 26379, ssl: true } , { host: 'localhost', port: 26381, ssl: true }, { host: 'localhost', port: 26380, ssl: true } ] } client = Redis.new(config) ```` However, it broke the case if you explicitly set `ssl` and expected it to propagate: ```ruby require 'redis' config = { name: 'mymaster', ssl: true, sentinels: [ { host: 'localhost', port: 26379 }, { host: 'localhost', port: 26381 }, { host: 'localhost', port: 26380 } ] } client = Redis.new(config) ```` Closes redis-rb#279
stanhu
added a commit
to stanhu/redis-client
that referenced
this pull request
Jan 8, 2026
PR redis-rb#277 fixed the issue where `ssl` was not set on the Redis client automatically if a `rediss://` URl were used: ```ruby require 'redis' config = { url: 'rediss://mymaster', sentinels: [ { host: 'localhost', port: 26379, ssl: true } , { host: 'localhost', port: 26381, ssl: true }, { host: 'localhost', port: 26380, ssl: true } ] } client = Redis.new(config) ```` However, it broke the case if you explicitly set `ssl` and expected it to propagate: ```ruby require 'redis' config = { name: 'mymaster', ssl: true, sentinels: [ { host: 'localhost', port: 26379 }, { host: 'localhost', port: 26381 }, { host: 'localhost', port: 26380 } ] } client = Redis.new(config) ```` Closes redis-rb#279
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When passing a
rediss://URL to SentinelConfig, the SSL setting was not being extracted from the URL scheme, causing SSL connections to fail silently. This was inconsistent with the regular Config class, which correctly extracts the SSL parameter.The issue was in the URL parsing logic where
ssl: url_config.ssl?was missing from the client_config hash that's built from the URL.This commit adds the missing SSL extraction and includes a test to verify that rediss:// URLs properly enable SSL for master/replica connections while keeping Sentinel connections unaffected.