Skip to content

Commit 8c3c5ef

Browse files
authored
add check for tls files when enableTLS (#167)
1 parent 1f237bd commit 8c3c5ef

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

client/src/main/java/io/hstream/impl/HStreamClientBuilderImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,13 @@ public HStreamClient build() {
7777
throw new HStreamDBClientException("hstreams url schema should enable tls");
7878
}
7979
if (enableTls) {
80+
checkNotNull(caPath);
8081
try {
8182
TlsChannelCredentials.Builder credentialsBuilder =
8283
TlsChannelCredentials.newBuilder().trustManager(new File(caPath));
8384
if (enableTlsAuthentication) {
85+
checkNotNull(certPath);
86+
checkNotNull(keyPath);
8487
credentialsBuilder = credentialsBuilder.keyManager(new File(certPath), new File(keyPath));
8588
}
8689
return new HStreamClientKtImpl(

0 commit comments

Comments
 (0)