1// +build go1.7 2 3package tlsconfig 4 5import ( 6 "crypto/x509" 7 "runtime" 8) 9 10// SystemCertPool returns a copy of the system cert pool, 11// returns an error if failed to load or empty pool on windows. 12func SystemCertPool() (*x509.CertPool, error) { 13 certpool, err := x509.SystemCertPool() 14 if err != nil && runtime.GOOS == "windows" { 15 return x509.NewCertPool(), nil 16 } 17 return certpool, err 18} 19