Skip to content

Commit

Permalink
Clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
nak3 committed Nov 25, 2021
1 parent 81046f2 commit 75f4696
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/e2e/grpc_test.go
Expand Up @@ -73,16 +73,16 @@ func dial(ctx *TestContext, host, domain string) (*grpc.ClientConn, error) {
if !hasPort(host) {
host = net.JoinHostPort(host, defaultPort)
}
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

0 comments on commit 75f4696

Please sign in to comment.