Skip to content
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

RedisURI.Builder#withSsl(RedisURI) not working with SslVerifyMode#CA #2182

Closed
kotovdv opened this issue Aug 10, 2022 · 0 comments
Closed

RedisURI.Builder#withSsl(RedisURI) not working with SslVerifyMode#CA #2182

kotovdv opened this issue Aug 10, 2022 · 0 comments
Labels
type: bug A general bug

Comments

@kotovdv
Copy link

kotovdv commented Aug 10, 2022

Bug Report

Current Behavior

RedisURI.Builder#withSsl(RedisURI) does not copy SslVerifyMode setting properly if it is set to SslVerifyMode#CA.

What it does instead is:

  1. It produces a boolean value using RedisURI#isVerifyPeer (which in case of SslVerifyMode#CA will result in true).
  2. It passes this boolean value to RedisURI.Builder#withVerifyPeer(boolean) which results in SslVerifyMode.FULL being set instead of SslVerifyMode#CA.

This logic is used in some internals of the lettuce itself (like RedisMasterReplicaNode class) which causes problems for us.

Expected behavior/code

Resulting state RedisURI.Builder should have SslVerifyMode#CA instead of SslVerifyMode#FULL

Possible Solution

Change the line in RedisURI.Builder#withSsl(io.lettuce.core.RedisURI) from

withVerifyPeer(source.isVerifyPeer());

to

withVerifyPeer(source.getVerifyMode());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants