Skip to content

GH-155: Delegate opening mTLS cert files to build() #783

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rtadepalli
Copy link
Contributor

What's Changed

Make FlightServer.Builder store File and delegate opening the file to the actual build() method.

Closes #155.

@rtadepalli
Copy link
Contributor Author

Could I please get a review @lidavidm thanks.

@lidavidm
Copy link
Member

Sorry - I have basically 0 time for arrow-java recently. I will try to get to all the reviews soon but I can't make any promises.

@@ -552,5 +570,20 @@ public Builder producer(FlightProducer producer) {
this.producer = Preconditions.checkNotNull(producer);
return this;
}

private void prepareTlsSettings() throws IOException {
Copy link
Member

Choose a reason for hiding this comment

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

The way this is written, if you set the File version then the deprecated version never takes effect, even if you set it afterwards. I suppose that's OK given the deprecation.

Comment on lines +229 to +231
closeMTlsCACert();
closeCertChain();
closeKey();
Copy link
Member

Choose a reason for hiding this comment

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

Honestly, this should be in a try-finally wrapping the entire build() call (since other exceptions in between this and the actual TLS settings will leak the handles). Either that, or this should be moved down to right before we use the file handles (and should still be in a try-finally)

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.

[Java][FlightRPC] FlightServer builder should store File, not InputStream
2 participants