Skip to content

Commit

Permalink
interop-testing: overrideAuthority breaks JWT
Browse files Browse the repository at this point in the history
Commit 65e4d9f broke the jwt_token_creds. It is believed to be because
the JWT does not see the authority passed to overrideAuthority. So the
changes to interop-testing client are temporarily reverted here. Note
that this breaks GRPC_PROXY_EXP testing, so the incompatibility needs to
be resolved.

Solving #2682 will allow reverting this change.

Fixes grpc/grpc#9497
Fixes #2680
  • Loading branch information
ejona86 committed Feb 1, 2017
1 parent e8aef5b commit 57b9105
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
import io.netty.handler.ssl.SslContext;
import java.io.File;
import java.io.FileInputStream;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;
import java.nio.charset.Charset;
import javax.net.ssl.SSLSocketFactory;

Expand Down Expand Up @@ -301,6 +304,16 @@ private class Tester extends AbstractInteropTest {
@Override
protected ManagedChannel createChannel() {
if (!useOkHttp) {
InetAddress address;
try {
address = InetAddress.getByName(serverHost);
if (serverHostOverride != null) {
// Force the hostname to match the cert the server uses.
address = InetAddress.getByAddress(serverHostOverride, address.getAddress());
}
} catch (UnknownHostException ex) {
throw new RuntimeException(ex);
}
SslContext sslContext = null;
if (useTestCa) {
try {
Expand All @@ -310,8 +323,7 @@ protected ManagedChannel createChannel() {
throw new RuntimeException(ex);
}
}
return NettyChannelBuilder.forAddress(serverHost, serverPort)
.overrideAuthority(serverHostOverride)
return NettyChannelBuilder.forAddress(new InetSocketAddress(address, serverPort))
.flowControlWindow(65 * 1024)
.negotiationType(useTls ? NegotiationType.TLS : NegotiationType.PLAINTEXT)
.sslContext(sslContext)
Expand Down

0 comments on commit 57b9105

Please sign in to comment.