Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 14, 05:15 UTC
reverse_proxy: Customize SNI value in upstream request (closes #2483)
Matthew Holt committed
Oct 10, 2019 at 17:17 UTC
8715a28320c78061b57d1889db8c12ce1ca283a8
1 file changed
+4
modules/caddyhttp/reverseproxy/httptransport.go
+4
@@ -147,6 +147,7 @@ type TLSConfig struct {
147
ClientCertificateKeyFile string `json:"client_certificate_key_file,omitempty"`
148
InsecureSkipVerify bool `json:"insecure_skip_verify,omitempty"`
149
HandshakeTimeout caddy.Duration `json:"handshake_timeout,omitempty"`
150
+ ServerName string `json:"server_name,omitempty"`
151
}
152
153
// MakeTLSClientConfig returns a tls.Config usable by a client to a backend.
@@ -182,6 +183,9 @@ func (t TLSConfig) MakeTLSClientConfig() (*tls.Config, error) {
183
cfg.RootCAs = rootPool
184
}
185
186
+ // custom SNI
187
+ cfg.ServerName = t.ServerName
188
+
189
// throw all security out the window
190
cfg.InsecureSkipVerify = t.InsecureSkipVerify
191