func loadCABundle(cafile string) (*x509.CertPool, error) {
	var pem []byte
	var err error

	if cafile == "" {
		pem, err = data.Asset("data/ca_bundle.pem")
	} else {
		pem, err = ioutil.ReadFile(cafile)

	}
	if err != nil {
		return nil, fmt.Errorf("Unable to find CA bundle.")
	}

	c := x509.NewCertPool()
	ok := c.AppendCertsFromPEM(pem)
	if !ok {
		return nil, fmt.Errorf("Unable to load CA bundle from %s.", cafile)
	}

	return c, nil
}
// Load CABundle creates a new CertPool from the given filename
Load CABundle creates a new CertPool from the given filename
// Load CABundle creates a new CertPool from the given filename
func loadCABundle(cafile string) (*x509.CertPool, error) {
	var pem []byte
	var err error
	if cafile == "" {
		pem, err = data.Asset("data/ca_bundle.pem")
	} else {
		pem, err = ioutil.ReadFile(cafile)
	}
	if err != nil {
		return nil, fmt.Errorf("Unable to find CA bundle.")
	}
	c := x509.NewCertPool()
	ok := c.AppendCertsFromPEM(pem)
	if !ok {
		return nil, fmt.Errorf("Unable to load CA bundle from %s.", cafile)
	}
	return c, nil
}
func loadCABundle ( cafile string ) ( * x509 . CertPool , error ) { var pem [ ] byte var err error if cafile == " " { pem , err = data . Asset ( " " ) } else { pem , err = ioutil . ReadFile ( cafile ) } if err != nil { return nil , fmt . Errorf ( " " ) } c := x509 . NewCertPool ( ) ok := c . AppendCertsFromPEM ( pem ) if ! ok { return nil , fmt . Errorf ( " " , cafile ) } return c , nil }
Load CABundle creates a new CertPool from the given filename
Load CABundle creates a new CertPool from the given filename