amitvijapur commented on code in PR #11180:
URL: https://github.com/apache/arrow-rs/pull/11180#discussion_r4177747195


##########
arrow-flight/src/bin/flight_sql_client.rs:
##########
@@ -398,12 +435,73 @@ fn setup_logging(args: LoggingArgs) -> Result<()> {
     Ok(())
 }
 
-async fn setup_client(args: ClientArgs) -> 
Result<FlightSqlServiceClient<Channel>> {
+/// Prefer a separate location, falling back to the original connection when 
permitted.
+fn select_endpoint_location<'a>(
+    locations: impl IntoIterator<Item = &'a str>,
+    tls: bool,
+) -> Result<Option<&'a str>> {
+    let mut reuse_connection = false;
+    let mut has_locations = false;
+    for uri in locations {
+        has_locations = true;
+        if uri.is_empty() || uri == REUSE_CONNECTION_URI {
+            reuse_connection = true;
+        } else if !tls || uri.starts_with("https://";) {

Review Comment:
   You are right. Corrected in 41643b6: the CLI selects canonical grpc/grpc+tcp 
plaintext or grpc+tls secure locations, then maps them to tonic HTTP/HTTPS 
transport URIs only when constructing the connection. grpc+tls enables TLS even 
without --tls; --tls still excludes plaintext-only choices. Connection reuse 
and the established bearer token are preserved. A wire-level regression detects 
the original plaintext HTTP/2 preface and verifies a TLS ClientHello after the 
correction. It tests TLS initiation, not a successful TLS session or 
certificate validation.



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