mirror of
https://github.com/caddyserver/caddy.git
synced 2026-08-04 14:58:47 +00:00
Make reverse proxy TLS server name replaceable for SNI upstreams.
This commit is contained in:
parent
1498132ea3
commit
7683eb294b
1 changed files with 5 additions and 0 deletions
|
|
@ -244,6 +244,11 @@ func (h *HTTPTransport) NewTransport(ctx caddy.Context) (*http.Transport, error)
|
|||
|
||||
// RoundTrip implements http.RoundTripper.
|
||||
func (h *HTTPTransport) RoundTrip(req *http.Request) (*http.Response, error) {
|
||||
repl := req.Context().Value(caddy.ReplacerCtxKey).(*caddy.Replacer)
|
||||
if h.Transport.TLSClientConfig != nil {
|
||||
h.Transport.TLSClientConfig.ServerName = repl.ReplaceAll(h.Transport.TLSClientConfig.ServerName, "")
|
||||
}
|
||||
|
||||
h.SetScheme(req)
|
||||
|
||||
// if H2C ("HTTP/2 over cleartext") is enabled and the upstream request is
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue