plugin/forward: fix TLS setup (#1714)

* plugin/forward: fix TLS setup

Way smaller PR than #1679. Fixes same thing.

* remove println

* put overwritten test back

* context

* update tests
This commit is contained in:
Miek Gieben
2018-04-24 18:18:26 +01:00
committed by GitHub
parent f529a2771f
commit ce084012df
3 changed files with 76 additions and 5 deletions

View File

@@ -57,8 +57,11 @@ func dnsClient(tlsConfig *tls.Config) *dns.Client {
return c
}
// SetTLSConfig sets the TLS config in the lower p.transport.
func (p *Proxy) SetTLSConfig(cfg *tls.Config) { p.transport.SetTLSConfig(cfg) }
// SetTLSConfig sets the TLS config in the lower p.transport and in the healthchecking client.
func (p *Proxy) SetTLSConfig(cfg *tls.Config) {
p.transport.SetTLSConfig(cfg)
p.client = dnsClient(cfg)
}
// SetExpire sets the expire duration in the lower p.transport.
func (p *Proxy) SetExpire(expire time.Duration) { p.transport.SetExpire(expire) }