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 <jacob.d.halsey@oracle.com>
Original pull request: #2329
  • Loading branch information
jacob-pro authored and mp911de committed Feb 15, 2023
1 parent d4e11c0 commit 85713fa
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 @@ -627,7 +627,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 85713fa

Please sign in to comment.