Skip to content

Commit c1011e4

Browse files
committed
Support client connection when transportMode=http,ssl=true, sslTrustStore specified without trustStorePassword in the JDBC URL
1 parent 23f32cf commit c1011e4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiConnection.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,8 @@ public long getRetryInterval() {
559559
// Pick trust store config from the given path
560560
sslTrustStore = KeyStore.getInstance(SSL_TRUST_STORE_TYPE);
561561
try (FileInputStream fis = new FileInputStream(sslTrustStorePath)) {
562-
sslTrustStore.load(fis, sslTrustStorePassword.toCharArray());
562+
sslTrustStore.load(
563+
fis, sslTrustStorePassword != null ? sslTrustStorePassword.toCharArray() : null);
563564
}
564565
sslContext = SSLContexts.custom().loadTrustMaterial(sslTrustStore, null).build();
565566
socketFactory =
@@ -685,7 +686,8 @@ SSLConnectionSocketFactory getTwoWaySSLSocketFactory() throws SQLException {
685686
SSL_TRUST_STORE + " Not configured for 2 way SSL connection");
686687
}
687688
try (FileInputStream fis = new FileInputStream(trustStorePath)) {
688-
sslTrustStore.load(fis, trustStorePassword.toCharArray());
689+
sslTrustStore.load(
690+
fis, trustStorePassword != null ? trustStorePassword.toCharArray() : null);
689691
}
690692
trustManagerFactory.init(sslTrustStore);
691693
SSLContext context = SSLContext.getInstance("TLS");

0 commit comments

Comments
 (0)