Skip to content
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

How to bypass hostname verification? #3880

Closed
shotahino opened this issue Dec 18, 2017 · 3 comments
Closed

How to bypass hostname verification? #3880

shotahino opened this issue Dec 18, 2017 · 3 comments
Labels

Comments

@shotahino
Copy link

shotahino commented Dec 18, 2017

There is an example of how to do this for grpc-go in here
And I'm looking for a similar solution for grpc-java.

I had been using overrideAuthority like this when the CN of the server certificate is known.
But I've come to a point where I can no longer keep doing this since the CN is not known beforehand. All I know is the IP address and port number in my use case.

  grpc = OkHttpChannelBuilder
            .forTarget("$address:$port")
            .sslSocketFactory(sslcontext.socketFactory)
            .overrideAuthority("xxxxxx")
            .build()
@carl-mastrangelo
Copy link
Contributor

Did you see the hostnameVerifier method on OkHttpChannelBuilder ?

@ejona86
Copy link
Member

ejona86 commented Jan 11, 2018

Note that we strongly discourage disabling hostname verification, as it defeats a critical part of the security model of TLS. But it seems this question is answered.

@ejona86 ejona86 closed this as completed Jan 11, 2018
@dcow
Copy link
Contributor

dcow commented Jan 12, 2018

I can comment. We are limiting our TLS to ca roots under our control. We will have a custom hostnameverifier that accounts for this so the attack vector that part of the model addresses does not exist for us, or where it does we understand the implications. We will also know the list of CNs we expect a-priori.. I believe Shota is referring to a debug "use case".

@lock lock bot locked as resolved and limited conversation to collaborators Sep 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants