-
Notifications
You must be signed in to change notification settings - Fork 972
[KYUUBI #5713] Backport HIVE-27271: Client connection to HS2 fails when transportMode=http, ssl=true, sslTrustStore specified without trustStorePassword in the JDBC URL #5712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -559,7 +559,8 @@ public long getRetryInterval() { | |
| // Pick trust store config from the given path | ||
| sslTrustStore = KeyStore.getInstance(SSL_TRUST_STORE_TYPE); | ||
| 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 = | ||
|
|
@@ -685,7 +686,8 @@ SSLConnectionSocketFactory getTwoWaySSLSocketFactory() throws SQLException { | |
| SSL_TRUST_STORE + " 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); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. new line is not needed
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Run
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see, thanks for the explantation |
||
| } | ||
| trustManagerFactory.init(sslTrustStore); | ||
| SSLContext context = SSLContext.getInstance("TLS"); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new line is not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run
mvn spotless:apply, automatically applies rule to a new line.