Skip to content

Commit

Permalink
HIVE-27271: Client connection to HS2 fails when transportMode=http, s…
Browse files Browse the repository at this point in the history
…sl=true, sslTrustStore specified without trustStorePassword in the JDBC URL

Closes apache#4262
  • Loading branch information
VenuReddy2103 authored and tarak271 committed Dec 19, 2023
1 parent f435827 commit 3c2c9ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ protected boolean requestIsAborted(final HttpRequest request) {
}
sslTrustStore = KeyStore.getInstance(trustStoreType);
try (FileInputStream fis = new FileInputStream(sslTrustStorePath)) {
sslTrustStore.load(fis, sslTrustStorePassword.toCharArray());
sslTrustStore.load(fis, sslTrustStorePassword != null ? sslTrustStorePassword.toCharArray() : null);
}
sslContext = SSLContexts.custom().loadTrustMaterial(sslTrustStore, null).build();
socketFactory =
Expand Down Expand Up @@ -1035,7 +1035,7 @@ SSLConnectionSocketFactory getTwoWaySSLSocketFactory() throws SQLException {
+ " Not configured for 2 way SSL connection");
}
try (FileInputStream fis = new FileInputStream(trustStorePath)) {
sslTrustStore.load(fis, trustStorePassword.toCharArray());
sslTrustStore.load(fis, trustStorePassword != null ? trustStorePassword.toCharArray() : null);
}
trustManagerFactory.init(sslTrustStore);
SSLContext context = SSLContext.getInstance("TLS");
Expand Down

0 comments on commit 3c2c9ca

Please sign in to comment.