mirror of https://github.com/grpc/grpc-java.git
Revert "interop-testing: overrideAuthority breaks JWT"
This reverts commit 57b9105c7f
.
Issue #2682 is fixed, so we can revert the commit as planned. This
re-applies a previously-reverted modernization.
This commit is contained in:
parent
946c29ac32
commit
924b0b2b00
|
@ -28,9 +28,6 @@ import io.grpc.okhttp.internal.Platform;
|
|||
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 @@ public class TestServiceClient {
|
|||
@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 @@ public class TestServiceClient {
|
|||
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)
|
||||
|
|
Loading…
Reference in New Issue