lidavidm commented on a change in pull request #7406:
URL: https://github.com/apache/arrow/pull/7406#discussion_r438958440
##########
File path: cpp/src/arrow/flight/flight_test.cc
##########
@@ -1601,6 +1620,26 @@ TEST_F(TestTls, OverrideHostname) {
ASSERT_RAISES(IOError, client->DoAction(options, action, &results));
}
+// Test the facility for setting generic transport options.
+TEST_F(TestTls, OverrideHostnameGeneric) {
+ std::unique_ptr<FlightClient> client;
+ auto client_options = FlightClientOptions();
+
client_options.generic_options.emplace_back(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG,
+ "fakehostname");
+ CertKeyPair root_cert;
+ ASSERT_OK(ExampleTlsCertificateRoot(&root_cert));
+ client_options.tls_root_certs = root_cert.pem_cert;
+ ASSERT_OK(FlightClient::Connect(location_, client_options, &client));
+
+ FlightCallOptions options;
+ options.timeout = TimeoutDuration{5.0};
+ Action action;
+ action.type = "test";
+ action.body = Buffer::FromString("");
+ std::unique_ptr<ResultStream> results;
+ ASSERT_RAISES(IOError, client->DoAction(options, action, &results));
Review comment:
I don't think so, unfortunately. I've added a comment to that effect.
##########
File path: python/pyarrow/_flight.pyx
##########
@@ -960,12 +960,17 @@ cdef class FlightClient:
Override the hostname checked by TLS. Insecure, use with caution.
middleware : list optional, default None
A list of ClientMiddlewareFactory instances.
+ generic_options : list optional, default None
+ A list of generic (string, int or string) option tuples passed
+ to the underlying transport. Effect is implementation
+ dependent.
"""
cdef:
unique_ptr[CFlightClient] client
def __init__(self, location, tls_root_certs=None, cert_chain=None,
- private_key=None, override_hostname=None, middleware=None):
+ private_key=None, override_hostname=None, middleware=None,
+ generic_options=None):
Review comment:
Done (same below as well).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]