Skip to content

Commit

Permalink
Apply SslVerifyMode in RedisURI. applySsl(…) #2328
Browse files Browse the repository at this point in the history
Co-authored-by: Jacob Halsey <[email protected]>
Original pull request: #2329
  • Loading branch information
jacob-pro authored Feb 15, 2023
1 parent dcd7085 commit 07a0e5b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/io/lettuce/core/RedisURI.java
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ public void applySsl(RedisURI source) {
LettuceAssert.notNull(source, "Source RedisURI must not be null");

setSsl(source.isSsl());
setVerifyPeer(source.isVerifyPeer());
setVerifyPeer(source.getVerifyMode());
setStartTls(source.isStartTls());
}

Expand Down
4 changes: 4 additions & 0 deletions src/test/java/io/lettuce/core/RedisURIUnitTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@ void shouldApplySslSettings() {
assertThat(target.isSsl()).isTrue();
assertThat(target.isVerifyPeer()).isFalse();
assertThat(target.isStartTls()).isTrue();

source.setVerifyPeer(SslVerifyMode.CA);
target.applySsl(source);
assertThat(target.getVerifyMode()).isEqualTo(SslVerifyMode.CA);
}

@Test
Expand Down

0 comments on commit 07a0e5b

Please sign in to comment.