core, netty: allow InputStream based certs#4316
Conversation
Allow ServerBuilder to read certs from InputStream, not just from a File.
|
/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. |
|
BTW: I also tracked the InputStreams through SslContextBuilder.forServer() (and similar) and verified that the methods take on the responsibility of closing the InputStream. |
ejona86
left a comment
There was a problem hiding this comment.
General changes seem fine. But the test seems unhelpful.
| */ | ||
| @Test | ||
| public void basicClientServerIntegrationTestInputStreamCerts() throws Exception { | ||
| InputStream serverCertChain = null; |
There was a problem hiding this comment.
None of these InputStreams are passed to our code. This test is not adding any value.
There was a problem hiding this comment.
These assigned to on lines 193/194 , 218/219 and used immediately after.
There was a problem hiding this comment.
I only see them passed to SslContextBuilder. That's Netty code, not gRPC code.
There was a problem hiding this comment.
I see, I will remove the test.
| import io.netty.handler.ssl.SslContextBuilder; | ||
| import io.netty.handler.ssl.SslProvider; | ||
| import java.io.File; | ||
| import java.io.FileInputStream; |
Allow ServerBuilder to read certs from InputStream, not just from a
File.
This PR revives #1881