From 3dcc95fa62a3e338e7c20e2b22d494a1ecbf8835 Mon Sep 17 00:00:00 2001 From: Andy Royle Date: Mon, 19 Nov 2018 16:50:56 +0000 Subject: [PATCH] allow servername override for grpcs --- proxy/grpc_handler.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/proxy/grpc_handler.go b/proxy/grpc_handler.go index f1489d5b0..3af727d2d 100644 --- a/proxy/grpc_handler.go +++ b/proxy/grpc_handler.go @@ -78,7 +78,11 @@ func GetGRPCDirector(cfg *config.Config, tlscfg *tls.Config) func(ctx context.Co if target.URL.Scheme == "grpcs" && tlscfg != nil { opts = append(opts, grpc.WithTransportCredentials( - credentials.NewTLS(&tls.Config{ClientCAs: tlscfg.ClientCAs, InsecureSkipVerify: target.TLSSkipVerify}))) + credentials.NewTLS(&tls.Config{ + ClientCAs: tlscfg.ClientCAs, + InsecureSkipVerify: target.TLSSkipVerify, + ServerName: target.Opts["grpcservername"], + }))) } newCtx := context.Background()