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
Commit 301a67f
Browse filesBrowse the repository at this point in the historyBrowse files
GH-1442: [JDBC] Harden hostnameOverride handling and tests (#1443)
Follow-up to #1363.
- Don't copy `hostnameOverride` in the
`ArrowFlightSqlClientHandler.Builder` copy constructor. The override is
only valid for the original host and port, so a copied builder no longer
carries it to another location by default. `getStreams` already sets it
explicitly for each endpoint, so behavior is unchanged.
- Trim `ArrowFlightConnectionConfigImpl.getHostnameOverride()` and
return `null` for blank values, as its Javadoc says.
- Record the `:authority` the server receives in
`ConnectionTlsHostnameOverrideTest`. The plaintext test now checks that
the connection's own host and port are sent, and a new test checks that
the override replaces the whole authority and that a port can be
included.
- Document that the override replaces the port in `:authority`, and that
a port can be included.
Closes#1442.
Copy file name to clipboardExpand all lines: flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/client/ArrowFlightSqlClientHandler.java
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -718,7 +718,8 @@ public static final class Builder {
718
718
publicBuilder() {}
719
719
720
720
/**
721
-
* Copies the builder.
721
+
* Copies the builder. The hostname override is not copied, since it is only valid for the
722
+
* original host and port.
722
723
*
723
724
* @param original The builder to base this copy off of.
Copy file name to clipboardExpand all lines: flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/utils/ArrowFlightConnectionConfigImpl.java
+8-3Lines changed: 8 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -115,10 +115,15 @@ public String getTlsRootCertificatesPath() {
115
115
/**
116
116
* Gets the hostname to use for TLS certificate verification and SNI instead of the host.
117
117
*
118
-
* @return the hostname override, or null if not set.
118
+
* @return the hostname override, or null if not set or blank.
Copy file name to clipboardExpand all lines: flight/flight-sql-jdbc-core/src/test/java/org/apache/arrow/driver/jdbc/ConnectionTlsHostnameOverrideTest.java
Copy file name to clipboardExpand all lines: flight/flight-sql-jdbc-core/src/test/java/org/apache/arrow/driver/jdbc/client/ArrowFlightSqlClientHandlerBuilderTest.java
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -155,14 +155,16 @@ public void testDefaults() {
Copy file name to clipboardExpand all lines: flight/flight-sql-jdbc-core/src/test/java/org/apache/arrow/driver/jdbc/utils/ArrowFlightConnectionConfigImplTest.java
0 commit comments