(sys *types.SystemContext)
| 64 | } |
| 65 | |
| 66 | func 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 | |
| 97 | func httpConfig() *http.Client { |
| 98 | return &http.Client{ |
no outgoing calls
searching dependent graphs…