Skip to content

Add support for Conscrypt with Netty#3401

Merged
ejona86 merged 2 commits intogrpc:masterfrom
ejona86:netty-conscrypt
Mar 23, 2018
Merged

Add support for Conscrypt with Netty#3401
ejona86 merged 2 commits intogrpc:masterfrom
ejona86:netty-conscrypt

Conversation

@ejona86
Copy link
Copy Markdown
Member

@ejona86 ejona86 commented Aug 25, 2017

The commits will be kept separate when merging.

Since Conscrypt has had some breaking changes, this should probably wait until Conscrypt 1.0 is released to avoid breakage. That implies there will be some changes still to this PR before it is merged, but they can't be done at this time and are relatively small in scope.

@ejona86 ejona86 force-pushed the netty-conscrypt branch 2 times, most recently from 58b2adb to ba55504 Compare August 28, 2017 17:46
@ejona86 ejona86 requested a review from ericgribkoff February 16, 2018 01:16
@ejona86 ejona86 added the kokoro:force-run Add this label to a PR to tell Kokoro to re-run all tests. Not generally necessary label Mar 6, 2018
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to a PR to tell Kokoro to re-run all tests. Not generally necessary label Mar 6, 2018
Copy link
Copy Markdown
Contributor

@ericgribkoff ericgribkoff left a comment

Choose a reason for hiding this comment

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

Sorry for the delay. LGTM, just a couple very minor comments.

private static final String SUN_PROVIDER_NAME = "SunJSSE";
private static final Method IS_CONSCRYPT_PROVIDER;

static {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this be wrapped in a function to provide an easier to understand stack trace if this ends up throwing?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I could, although I find it more confusing to have static methods that are called before static initialization completes. It's necessary and helpful at times, but when unnecessary I try to avoid it as I find it to be bug-prone.

logger.log(Level.FINE, "Selecting JDK with provider {0}", provider);
return SslProvider.JDK;
}
logger.log(Level.INFO, "netty-tcnative unavailable (this may be normal)",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we expect the IllegalStateException to be caught somewhere? It looks like in the current flow this propagates back through the NettyChannelBuilder, in which case it seems a little confusing to say "(this may be normal)" for all of these when we're about to fail. I think the intent is that it might be normal for two out of the three to be missing, but the current message seems to imply it's ok for all of them to be missing. Maybe add an initial "One of the following TLS ALPN providers must be available:" log statement and drop the "(this may be normal)" text?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Spoke offline. The main reason I didn't do that is because then the error is reported in two places: the log message and the exception. Right now the log messages are just informational and it's only after you get the exception that you can look at them and think "these might be useful."

@ejona86
Copy link
Copy Markdown
Member Author

ejona86 commented Mar 23, 2018

OkHttp+Conscrypt+Windows is flaky. I've reverted the change to use Conscrypt in interop-testing's unit tests and the test client; we continue to use Jetty ALPN there for the moment.

@ejona86 ejona86 merged commit 7eab0d9 into grpc:master Mar 23, 2018
@ejona86 ejona86 deleted the netty-conscrypt branch March 23, 2018 17:05
@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.

3 participants