Repository navigation
Conversation
getRedisClusterClient() took the SSL flag of each cluster node entry. Those entries are created by RedisConnectionConfig.Builder.build() from host and port only, so their sslEnable is always false and the cluster client connected without TLS even with withSslEnable(true). Use the flag of the data source config, like the standalone and Sentinel clients and like the timeout and password of the cluster nodes. Fixes alibaba#3533
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
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.
Describe what this PR does / why we need it
With a Redis Cluster data source,
withSslEnable(true)has no effect: the client connects to the nodes without TLS.Does this pull request fix one issue?
Fixes #3533
Describe how you did it
getRedisClusterClient()read the SSL flag from eachgetRedisClusters()entry.Builder.build()creates those entries from host and port only, so theirsslEnableis always false. The node URIs now use the data source's flag, like the standalone and Sentinel clients, and like the cluster nodes' timeout and password.Describe how to verify it
ClusterModeRedisDataSourceSslTestpoints an SSL-enabled cluster data source at a local socket and checks the first byte sent:*(plain RESP) before the change,0x16(TLS ClientHello) after.Special notes for reviews
None.