MCPcopy Create free account
hub / github.com/cloudfoundry/credhub-cli / httpsClient

Function httpsClient

credhub/client.go:41–67  ·  view source on GitHub ↗
(insecureSkipVerify bool, rootCAs *x509.CertPool, cert *tls.Certificate, timeout *time.Duration)

Source from the content-addressed store, hash-verified

39}
40
41func httpsClient(insecureSkipVerify bool, rootCAs *x509.CertPool, cert *tls.Certificate, timeout *time.Duration) *http.Client {
42 client := httpClient(timeout)
43 var certs []tls.Certificate
44 if cert != nil {
45 certs = []tls.Certificate{*cert}
46 }
47
48 var dialer = SOCKS5DialFuncFromEnvironment((&net.Dialer{
49 Timeout: 30 * time.Second,
50 KeepAlive: 30 * time.Second,
51 }).Dial, proxy.NewSocks5Proxy(proxy.NewHostKey(), nil, 30*time.Second))
52
53 client.Transport = &http.Transport{
54 TLSClientConfig: &tls.Config{
55 InsecureSkipVerify: insecureSkipVerify,
56 PreferServerCipherSuites: true,
57 Certificates: certs,
58 RootCAs: rootCAs,
59 MinVersion: tls.VersionTLS12,
60 },
61 Proxy: http.ProxyFromEnvironment,
62 Dial: dialer,
63 MaxIdleConnsPerHost: 100,
64 }
65
66 return client
67}

Callers 1

clientMethod · 0.85

Calls 2

httpClientFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…