Add util to set transport defaults

This commit is contained in:
Jordan Liggitt
2015-10-02 00:30:49 -04:00
parent 719cf5617e
commit 2a1286c8f2
5 changed files with 30 additions and 29 deletions

View File

@@ -380,15 +380,9 @@ func tlsTransportFor(config *Config) (http.RoundTripper, error) {
}
// Cache a single transport for these options
tlsTransports[key] = &http.Transport{
tlsTransports[key] = util.SetTransportDefaults(&http.Transport{
TLSClientConfig: tlsConfig,
Proxy: http.ProxyFromEnvironment,
Dial: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
}).Dial,
TLSHandshakeTimeout: 10 * time.Second,
}
})
return tlsTransports[key], nil
}