From c71496f65608221ef8017b8c0ba5b32df3956628 Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Wed, 19 Jul 2017 11:06:57 -0700 Subject: [PATCH] Revert "interop-testing: overrideAuthority breaks JWT" This reverts commit 57b9105c7f14b52a3ed132302af1af59fc869281. Issue #2682 is fixed, so we can revert the commit as planned. This re-applies a previously-reverted modernization. --- .../testing/integration/TestServiceClient.java | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceClient.java b/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceClient.java index 08425cd9458..d18ef610bba 100644 --- a/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceClient.java +++ b/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceClient.java @@ -28,9 +28,6 @@ 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; @@ -296,16 +293,6 @@ 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 { @@ -315,7 +302,8 @@ protected ManagedChannel createChannel() { throw new RuntimeException(ex); } } - return NettyChannelBuilder.forAddress(new InetSocketAddress(address, serverPort)) + return NettyChannelBuilder.forAddress(serverHost, serverPort) + .overrideAuthority(serverHostOverride) .flowControlWindow(65 * 1024) .negotiationType(useTls ? NegotiationType.TLS : NegotiationType.PLAINTEXT) .sslContext(sslContext)