Add tls_server_name option to policy file.

This commit is contained in:
Yuchen Ying 2019-09-06 09:48:31 +00:00
parent 658e80f2af
commit 27a3870373
5 changed files with 27 additions and 0 deletions

View file

@ -186,6 +186,12 @@ func (p *Proxy) UpdatePolicies(opts *config.Options) error {
log.Debug().Str("to", policy.Source.String()).Msg("proxy: client certs enabled")
}
if policy.TLSServerName != "" {
tlsClientConfig.ServerName = policy.TLSServerName
isCustomClientConfig = true
log.Debug().Str("to", policy.Source.String()).Msgf("proxy: tls hostname override to: %s", policy.TLSServerName)
}
// We avoid setting a custom client config unless we have to as
// if TLSClientConfig is nil, the default configuration is used.
if isCustomClientConfig {