Arawoof06 opened a new pull request, #1496:
URL: https://github.com/apache/arrow-java/pull/1496

   ## What's Changed
   
   `ArrowFlightSqlClientHandler.Builder.build()` picks the TLS trust source in 
the order `tlsRootCerts`, `useSystemTrustStore`, `trustStore`. 
`useSystemTrustStore` defaults to true, so a connection configured with 
`trustStore` and `trustStorePassword` but without `useSystemTrustStore=false` 
never reads that trust store. The server is validated against the system store 
instead, which is opened with the trust store's password. When that password 
matches the JDK `cacerts` (`changeit`), or on Windows and macOS where the 
system keychains need none, any certificate chaining to a system CA is accepted 
even though the user limited trust to their own CA, and the handshake then 
sends the credentials to that server. Otherwise the connection fails with 
"Keystore was tampered with, or password was incorrect", which is why every 
existing test sets `useSystemTrustStore=false` next to `trustStore`.
   
   An explicit `trustStore` now takes precedence over the system store, the 
same way `tlsRootCerts` already does, and the docs say `useSystemTrustStore` is 
ignored when either is set. Configurations that already set 
`useSystemTrustStore=false` are unaffected. The new test in `ConnectionTlsTest` 
connects with `trustStore` and the default `useSystemTrustStore` and fails 
without this change. 
`testGetAuthenticatedEncryptedConnectionWithKeyStoreBadPassword` still passes, 
now failing on the configured trust store rather than on `cacerts`.
   


-- 
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]

Reply via email to