MCPcopy Index your code
hub / github.com/cloudfoundry/cli / NewTLSConfig

Function NewTLSConfig

util/tls.go:10–26  ·  view source on GitHub ↗
(trustedCerts []*x509.Certificate, skipTLSValidation bool)

Source from the content-addressed store, hash-verified

8)
9
10func NewTLSConfig(trustedCerts []*x509.Certificate, skipTLSValidation bool) *tls.Config {
11 config := &tls.Config{}
12
13 _ = tlsconfig.WithExternalServiceDefaults()(config) //nolint - always returns nil
14
15 if len(trustedCerts) > 0 {
16 certPool := x509.NewCertPool()
17 for _, tlsCert := range trustedCerts {
18 certPool.AddCert(tlsCert)
19 }
20 config.RootCAs = certPool
21 }
22
23 config.InsecureSkipVerify = skipTLSValidation
24
25 return config
26}

Callers 11

downloadBuildpackMethod · 0.92
AuthorizeMethod · 0.92
makeHTTPTransportFunction · 0.92
DownloadFileMethod · 0.92
NewConnectionFunction · 0.92
NewConnectionFunction · 0.92
NewClientFunction · 0.92
NewConnectionFunction · 0.92
NewConnectionFunction · 0.92
NewDownloaderFunction · 0.92
tls_test.goFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected