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

Do not append the port to authority #12350

Merged
merged 3 commits into from Nov 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions test/e2e/grpc_test.go
Expand Up @@ -73,19 +73,19 @@ func dial(ctx *TestContext, host, domain string) (*grpc.ClientConn, error) {
if !hasPort(host) {
host = net.JoinHostPort(host, defaultPort)
}
if !hasPort(domain) {
domain = net.JoinHostPort(domain, defaultPort)
if hasPort(domain) {
var err error
domain, _, err = net.SplitHostPort(domain)
if err != nil {
return nil, err
}
}

secureOpt := grpc.WithInsecure()
if test.ServingFlags.HTTPS {
tlsConfig := test.TLSClientConfig(context.Background(), ctx.t.Logf, ctx.clients)
// Set ServerName for pseudo hostname with TLS.
var err error
tlsConfig.ServerName, _, err = net.SplitHostPort(domain)
if err != nil {
return nil, err
}
tlsConfig.ServerName = domain
secureOpt = grpc.WithTransportCredentials(credentials.NewTLS(tlsConfig))
}

Expand Down