From 35256434a58ed5bfc9de0e3c95b9ddf5cdfb86a3 Mon Sep 17 00:00:00 2001 From: Nathan Johnson Date: Wed, 7 Dec 2022 14:12:43 -0600 Subject: [PATCH] Don't use "dst" literal as sni name on https backends with host=dst is set Fixes #916 --- route/route.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/route/route.go b/route/route.go index 996e21c90..3584f012f 100644 --- a/route/route.go +++ b/route/route.go @@ -75,7 +75,9 @@ func (r *Route) addTarget(service string, targetURL *url.URL, fixedWeight float6 t.Host = opts["host"] t.ProxyProto = opts["pxyproto"] == "true" - if t.Host != "" && (t.URL.Scheme == "https" || opts["proto"] == "https") { + // if Host is "dst", we don't need a special transport to override the sni because + // this is already the default behavior. + if t.Host != "" && t.Host != "dst" && (t.URL.Scheme == "https" || opts["proto"] == "https") { t.Transport = transport.NewTransport(&tls.Config{ServerName: t.Host, InsecureSkipVerify: t.TLSSkipVerify}) }