You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[JDBC] Harden trustStore and tlsRootCerts handling for blank values and missing password #1500
Blank trustStore / tlsRootCerts values are treated as file paths: ArrowFlightConnectionConfigImpl#getTrustStorePath(), ArrowFlightConnectionConfigImpl#getTlsRootCertificatesPath(), and the corresponding ArrowFlightSqlClientHandler.Builder setters treat empty or whitespace-only strings (for example ?trustStore=&useSystemTrustStore=true or ?tlsRootCerts=&trustStore=...) as non-null paths instead of unset. Since GH-1499: [JDBC] Prefer an explicit trustStore over the system trust store #1496 gave trustStore precedence over useSystemTrustStore, a blank trustStore="" now shadows useSystemTrustStore and fails trying to open an empty path instead of falling back.
Missing trustStorePassword throws an uncaught NullPointerException:
When trustStore is configured without trustStorePassword, ClientAuthenticationUtils.getCertificateStream() throws NullPointerException via Preconditions.checkNotNull, which bypasses ArrowFlightSqlClientHandler.Builder#build()'s catch block (so it is not wrapped in SQLException) and bypasses ArrowFlightConnection#createNewClientHandler()'s allocator cleanup.
Javadoc and test assertions:
ArrowFlightSqlClientHandler.Builder#withSystemTrustStore Javadoc does not document that it is ignored when trustStorePath or tlsRootCertificatesPath is set (matching docs/source/flight_sql_jdbc_driver.rst).
ConnectionTlsTest#testGetAuthenticatedEncryptedConnectionWithKeyStoreBadPassword only checks that any SQLException is thrown rather than verifying the keystore password failure cause.
Expected behavior
Blank trustStore and tlsRootCerts values are treated as unset (null), consistent with hostnameOverride.
Configuring trustStore without trustStorePassword fails cleanly with SQLException (wrapping IllegalArgumentException) and closes the connection allocator.
Builder Javadoc and tests accurately document and verify these behaviors.
Activity
apacheGH-1500: [JDBC] Harden trustStore and tlsRootCerts handling for…