Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Jun 18, 2019

Adds the ability to override hostname checks, so you can connect to localhost over TLS but still verify that the certificate is for some other domain.

Example: when deploying on Kubernetes with headless services, clients connect directly to backend services and do load balancing themselves. Thus all instances of an application must present a certificate for the same hostname. To do health checks in such an environment, you can't connect to the TLS hostname (which may resolve to a different instance); you need to connect to localhost, and override the hostname check.

Also needs apache/arrow-testing#5

Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you rebase? The TLS tests in test_flight.py were fixed recently on master.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to mark it insecure?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can shorten the name, but I'd at least like to stress that it's potentially a footgun in production.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... interesting. The certificate error is not raised at connect time?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gRPC doesn't actually try to make a connection until an RPC is issued, generally.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an error message we can check?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is, but I've been bitten elsewhere by messages that changed across gRPC versions...once #4484 lands, I'd rather we wrap and expose the gRPC error code + error message instead of just a message (and maybe map error codes to a set of Flight codes).

@ghost
Copy link
Author

ghost commented Jun 20, 2019

Rebased, shortened name to "override_hostname".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok... you have to pass the connect_args as above, otherwise flight_server may be stuck in a loop trying to reconnect.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.> Right, thanks.

@pitrou pitrou closed this in f180a53 Jun 24, 2019
@patcollis34
Copy link

hey @pitrou this probably isn't the place for this question but I can't find an issue that matches my problem more closely. I was wondering if there was good example of deploying a python flight server/service into kubernetes. I'm using the pyarrow cookbook for the flight server and am getting hung up on some gotcha in the service or deployment config, or maybe something with the URL. any help or guidance would be much appreciated

@pitrou
Copy link
Member

pitrou commented Jul 23, 2022

@patcollis34 I don't have an answer, I suggest you ask on the user mailing-list.

pribor pushed a commit to GlobalWebIndex/arrow that referenced this pull request Oct 24, 2025
Adds the ability to override hostname checks, so you can connect to localhost over TLS but still verify that the certificate is for some other domain.

Example: when deploying on Kubernetes with headless services, clients connect directly to backend services and do load balancing themselves. Thus all instances of an application must present a certificate for the same hostname. To do health checks in such an environment, you can't connect to the TLS hostname (which may resolve to a different instance); you need to connect to localhost, and override the hostname check.

Also needs apache/arrow-testing#5

Author: David Li <[email protected]>

Closes apache#4608 from lihalite/flight-tls-java and squashes the following commits:

581fc75 <David Li> Add ability to override SSL hostname checking
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants