Merge pull request #120 from riyazdf/system-pool-fix

trust: do not call x509.SystemCertPool as nil will use this as default
This commit is contained in:
Justin Cormack 2017-07-14 22:53:24 +01:00 committed by GitHub
commit f035995b22

View File

@ -194,13 +194,7 @@ func httpsTransport(caFile string) (*http.Transport, error) {
TLSClientConfig: tlsConfig,
}
// Override with the system cert pool if the caFile was empty
if caFile == "" {
systemCertPool, err := x509.SystemCertPool()
if err != nil {
return nil, err
}
transport.TLSClientConfig.RootCAs = systemCertPool
} else {
if caFile != "" {
certPool := x509.NewCertPool()
pems, err := ioutil.ReadFile(caFile)
if err != nil {