Browse Source

reverse_proxy: Customize SNI value in upstream request (closes #2483)

master
Matthew Holt 6 years ago
parent
commit
8715a28320
No known key found for this signature in database GPG Key ID: 2A349DD577D586A5
  1. 4
      modules/caddyhttp/reverseproxy/httptransport.go

4
modules/caddyhttp/reverseproxy/httptransport.go

@ -147,6 +147,7 @@ type TLSConfig struct {
ClientCertificateKeyFile string `json:"client_certificate_key_file,omitempty"` ClientCertificateKeyFile string `json:"client_certificate_key_file,omitempty"`
InsecureSkipVerify bool `json:"insecure_skip_verify,omitempty"` InsecureSkipVerify bool `json:"insecure_skip_verify,omitempty"`
HandshakeTimeout caddy.Duration `json:"handshake_timeout,omitempty"` HandshakeTimeout caddy.Duration `json:"handshake_timeout,omitempty"`
ServerName string `json:"server_name,omitempty"`
} }
// MakeTLSClientConfig returns a tls.Config usable by a client to a backend. // MakeTLSClientConfig returns a tls.Config usable by a client to a backend.
@ -182,6 +183,9 @@ func (t TLSConfig) MakeTLSClientConfig() (*tls.Config, error) {
cfg.RootCAs = rootPool cfg.RootCAs = rootPool
} }
// custom SNI
cfg.ServerName = t.ServerName
// throw all security out the window // throw all security out the window
cfg.InsecureSkipVerify = t.InsecureSkipVerify cfg.InsecureSkipVerify = t.InsecureSkipVerify

Loading…
Cancel
Save