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

interop-testing: overrideAuthority breaks JWT #2683

Merged
merged 1 commit into from
Feb 1, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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