mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 01:59:07 +00:00
trust: do not call x509.SystemCertPool as nil will use this as default
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
This commit is contained in:
parent
f255d671c6
commit
c3b2c7d575
@ -194,13 +194,7 @@ func httpsTransport(caFile string) (*http.Transport, error) {
|
|||||||
TLSClientConfig: tlsConfig,
|
TLSClientConfig: tlsConfig,
|
||||||
}
|
}
|
||||||
// Override with the system cert pool if the caFile was empty
|
// Override with the system cert pool if the caFile was empty
|
||||||
if caFile == "" {
|
if caFile != "" {
|
||||||
systemCertPool, err := x509.SystemCertPool()
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
transport.TLSClientConfig.RootCAs = systemCertPool
|
|
||||||
} else {
|
|
||||||
certPool := x509.NewCertPool()
|
certPool := x509.NewCertPool()
|
||||||
pems, err := ioutil.ReadFile(caFile)
|
pems, err := ioutil.ReadFile(caFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user