diff --git a/proxy/grpc_handler.go b/proxy/grpc_handler.go index 642dd5a7c..675f5a0ab 100644 --- a/proxy/grpc_handler.go +++ b/proxy/grpc_handler.go @@ -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"], }))) } diff --git a/route/parse_test.go b/route/parse_test.go index 49328409c..5c3159226 100644 --- a/route/parse_test.go +++ b/route/parse_test.go @@ -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`,