mirror of
https://github.com/mayflower/docker-ls.git
synced 2025-11-26 12:03:12 +03:00
22 lines
316 B
Go
22 lines
316 B
Go
package connector
|
|
|
|
import (
|
|
"crypto/tls"
|
|
"net/http"
|
|
)
|
|
|
|
func createHttpClient(cfg Config) *http.Client {
|
|
var tlsConfig *tls.Config
|
|
if cfg.AllowInsecure() {
|
|
tlsConfig = &tls.Config{
|
|
InsecureSkipVerify: true,
|
|
}
|
|
}
|
|
|
|
return &http.Client{
|
|
Transport: &http.Transport{
|
|
TLSClientConfig: tlsConfig,
|
|
},
|
|
}
|
|
}
|