javatls1.2apache-arrowapache-arrow-flight

How do I enable TLS on an Apache Arrow FlightClient in Java?


The documentation for the Java Apache Arrow (v11.0.0) FlightClient.Builder has several methods related to constructing a TLS-enabled client:

The descriptions aren't detailed enough for me to understand which ones are needed to enable and use TLS in connections with a FlightServer. There could easily be some gap in my understanding of TLS that would help me more easily consume this documentation.

Do I need to use all of these? Are some of them redundant? How are they related?


Solution

  • I took a look at the code that implements this API for some insights.

    useTls simply tells the underlying client builder to start putting together SSL Context for the TLS-enabled client. The same effect is achieved by having the grpc+tls scheme attached to the location attribute.

    The rest of the options are used for adding to the SSL Context. The context builder is provided by io.netty.handler.ssl.SslContextBuilder.

    Do I need to use all of these (ignoring overrideHostname)? It depends on how the TLS is configured on the server the client will connect to.

    Are any of them redundant? useTls() is redundant if the location attribute already has the TLS scheme attached.