jbonofre opened a new issue, #1500:
URL: https://github.com/apache/arrow-java/issues/1500
Follow-up to #1496 (#1499).
### Describe the bug
1. **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
#1496 gave `trustStore` precedence over `useSystemTrustStore`, a blank
`trustStore=""` now shadows `useSystemTrustStore` and fails trying to open an
empty path instead of falling back.
2. **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.
3. **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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]