MCPcopy Create free account
hub / github.com/containers/image / tlsConfig

Function tlsConfig

docker/daemon/client.go:66–95  ·  view source on GitHub ↗
(sys *types.SystemContext)

Source from the content-addressed store, hash-verified

64}
65
66func tlsConfig(sys *types.SystemContext) (*http.Client, error) {
67 options := tlsconfig.Options{}
68 if sys != nil && sys.DockerDaemonInsecureSkipTLSVerify {
69 options.InsecureSkipVerify = true
70 }
71
72 if sys != nil && sys.DockerDaemonCertPath != "" {
73 options.CAFile = filepath.Join(sys.DockerDaemonCertPath, "ca.pem")
74 options.CertFile = filepath.Join(sys.DockerDaemonCertPath, "cert.pem")
75 options.KeyFile = filepath.Join(sys.DockerDaemonCertPath, "key.pem")
76 }
77
78 tlsc, err := tlsconfig.Client(options)
79 if err != nil {
80 return nil, err
81 }
82
83 return &http.Client{
84 Transport: &http.Transport{
85 Proxy: http.ProxyFromEnvironment,
86 TLSClientConfig: tlsc,
87 // In general we want to follow docker/daemon/client.defaultHTTPClient , as long as it doesn’t affect compatibility.
88 // These idle connection limits really only apply to long-running clients, which is not our case here;
89 // we include the same values purely for symmetry.
90 MaxIdleConns: 6,
91 IdleConnTimeout: 30 * time.Second,
92 },
93 CheckRedirect: dockerclient.CheckRedirect,
94 }, nil
95}
96
97func httpConfig() *http.Client {
98 return &http.Client{

Callers 4

TestSkipTLSVerifyOnlyFunction · 0.85
newDockerClientFunction · 0.85

Calls

no outgoing calls

Tested by 3

TestSkipTLSVerifyOnlyFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…