Skip to content

Commit

Permalink
add comment for grpcservername override
Browse files Browse the repository at this point in the history
  • Loading branch information
andyroyle committed Nov 22, 2018
1 parent 5807777 commit eebb625
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion proxy/grpc_handler.go
Expand Up @@ -81,7 +81,10 @@ func GetGRPCDirector(cfg *config.Config, tlscfg *tls.Config) func(ctx context.Co
credentials.NewTLS(&tls.Config{
ClientCAs: tlscfg.ClientCAs,
InsecureSkipVerify: target.TLSSkipVerify,
ServerName: target.Opts["grpcservername"],
// as per the http/2 spec, the host header isn't required, so if your
// target service doesn't have IP SANs in it's certificate
// then you will need to override the servername
ServerName: target.Opts["grpcservername"],
})))
}

Expand Down
5 changes: 5 additions & 0 deletions route/parse_test.go
Expand Up @@ -31,6 +31,11 @@ func TestParse(t *testing.T) {
in: `route add svc :1234 tcp://1.2.3.4:5678`,
out: []*RouteDef{{Cmd: RouteAddCmd, Service: "svc", Src: ":1234", Dst: "tcp://1.2.3.4:5678"}},
},
{
desc: "RouteAddGRPCService",
in: `route add svc :1234 grpc://1.2.3.4:5678`,
out: []*RouteDef{{Cmd: RouteAddCmd, Service: "svc", Src: ":1234", Dst: "grpc://1.2.3.4:5678"}},
},
{
desc: "RouteAddServiceWeight",
in: `route add svc /prefix http://1.2.3.4/ weight 1.2`,
Expand Down

0 comments on commit eebb625

Please sign in to comment.