Repository navigation
Commit 4fcf67e
authored
## 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`.
Closes #1499.
1 parent db524b6 commit 4fcf67e
3 files changed
Lines changed: 34 additions & 5 deletions
File tree
- docs/source
- flight/flight-sql-jdbc-core/src
- main/java/org/apache/arrow/driver/jdbc/client
- test/java/org/apache/arrow/driver/jdbc
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
| 159 | + | |
159 | 160 | | |
160 | 161 | | |
161 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1154 | 1154 | | |
1155 | 1155 | | |
1156 | 1156 | | |
1157 | | - | |
1158 | | - | |
1159 | | - | |
1160 | | - | |
1161 | 1157 | | |
1162 | 1158 | | |
1163 | 1159 | | |
1164 | 1160 | | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
1165 | 1165 | | |
1166 | 1166 | | |
1167 | 1167 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
297 | 325 | | |
298 | 326 | | |
299 | 327 | | |
| |||
0 commit comments