Skip to content

Commit

Permalink
Don't use "dst" literal as sni name on https backends with host=dst i…
Browse files Browse the repository at this point in the history
…s set

Fixes #916
  • Loading branch information
nathanejohnson committed Dec 7, 2022
1 parent 458c701 commit 3525643
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion route/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -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})
}

Expand Down

0 comments on commit 3525643

Please sign in to comment.