mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-07-05 19:04:23 +08:00
Conflicts: Gopkg.lock pkg/appsrv/appsrv.go pkg/cloudcommon/options.go pkg/compute/models/hosts.go pkg/compute/models/quotas.go pkg/compute/service/service.go pkg/mcclient/mcclient.go
20 lines
422 B
Go
20 lines
422 B
Go
package httptoo
|
|
|
|
import (
|
|
"crypto/tls"
|
|
"net/http"
|
|
)
|
|
|
|
// Returns the http.Client's TLS Config, traversing and generating any
|
|
// defaults along the way to get it.
|
|
func ClientTLSConfig(cl *http.Client) *tls.Config {
|
|
if cl.Transport == nil {
|
|
cl.Transport = http.DefaultTransport
|
|
}
|
|
tr := cl.Transport.(*http.Transport)
|
|
if tr.TLSClientConfig == nil {
|
|
tr.TLSClientConfig = &tls.Config{}
|
|
}
|
|
return tr.TLSClientConfig
|
|
}
|