Skip to content

core, netty: allow InputStream based certs #4316

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

Merged
merged 3 commits into from
Apr 11, 2018

Conversation

zpencer
Copy link
Contributor

@zpencer zpencer commented Apr 6, 2018

Allow ServerBuilder to read certs from InputStream, not just from a
File.

This PR revives #1881

Allow ServerBuilder to read certs from InputStream, not just from a
File.
@zpencer zpencer requested a review from ejona86 April 6, 2018 23:13
@ejona86
Copy link
Member

ejona86 commented Apr 6, 2018

/me runs over to compare to a branch I was working on https://github.com/ejona86/grpc-java/commits/security-inputstream, which I got pulled in via #1791 (comment) 😄

This seems fine, and appears to be a subset of what I was working on, since I was more focused on cleaning up the current test references. I want to look at the TlsTest a little bit.

@ejona86
Copy link
Member

ejona86 commented Apr 6, 2018

BTW: I also tracked the InputStreams through SslContextBuilder.forServer() (and similar) and verified that the methods take on the responsibility of closing the InputStream.

Copy link
Member

@ejona86 ejona86 left a comment

Choose a reason for hiding this comment

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

General changes seem fine. But the test seems unhelpful.

*/
@Test
public void basicClientServerIntegrationTestInputStreamCerts() throws Exception {
InputStream serverCertChain = null;
Copy link
Member

Choose a reason for hiding this comment

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

None of these InputStreams are passed to our code. This test is not adding any value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These assigned to on lines 193/194 , 218/219 and used immediately after.

Copy link
Member

Choose a reason for hiding this comment

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

I only see them passed to SslContextBuilder. That's Netty code, not gRPC code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, I will remove the test.

@@ -37,7 +37,9 @@
import io.netty.handler.ssl.SslContextBuilder;
import io.netty.handler.ssl.SslProvider;
import java.io.File;
import java.io.FileInputStream;
Copy link
Member

Choose a reason for hiding this comment

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

Revert changes to this file.

@zpencer zpencer merged commit 137e759 into grpc:master Apr 11, 2018
@zpencer zpencer deleted the ssl-inputstream-2 branch April 11, 2018 23:15
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants