1
0
mirror of https://github.com/go-acme/lego.git synced 2025-02-12 07:55:57 +02:00

dnsmadeeasy: use default transport (#2362)

This commit is contained in:
Ludovic Fernandez 2024-11-27 14:34:46 +01:00 committed by GitHub
parent abccd21e75
commit 2c42b264d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -47,15 +47,22 @@ type Config struct {
// NewDefaultConfig returns a default configuration for the DNSProvider.
func NewDefaultConfig() *Config {
tr := &http.Transport{}
defaultTransport, ok := http.DefaultTransport.(*http.Transport)
if ok {
tr = defaultTransport.Clone()
}
tr.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
return &Config{
TTL: env.GetOrDefaultInt(EnvTTL, dns01.DefaultTTL),
PropagationTimeout: env.GetOrDefaultSecond(EnvPropagationTimeout, dns01.DefaultPropagationTimeout),
PollingInterval: env.GetOrDefaultSecond(EnvPollingInterval, dns01.DefaultPollingInterval),
HTTPClient: &http.Client{
Timeout: env.GetOrDefaultSecond(EnvHTTPTimeout, 10*time.Second),
Transport: &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
},
Timeout: env.GetOrDefaultSecond(EnvHTTPTimeout, 10*time.Second),
Transport: tr,
},
}
}