func CreateCertPool(caCert string) (*x509.CertPool, error) {

	pool := x509.NewCertPool()
	if caCert != "" {
		xcert, err := cert.ParseCert(caCert)
		if err != nil {
			return nil, errors.Annotatef(err, "cannot parse certificate %q", caCert)
		}
		pool.AddCert(xcert)
	}

	count := processCertDir(pool)
	if count >= 0 {
		logger.Debugf("added %d certs to the pool from %s", count, certDir)
	}

	return pool, nil
}
// CreateCertPool creates a new x509.CertPool and adds in the caCert passed
// in.  All certs from the cert directory (/etc/juju/cert.d on ubuntu) are
// also added.
CreateCertPool creates a new x509.CertPool and adds in the caCert passed
in.  All certs from the cert directory (/etc/juju/cert.d on ubuntu) are
also added.
// CreateCertPool creates a new x509 . CertPool and adds in the caCert passed // in . All certs from the cert directory ( / etc / juju / cert . d on ubuntu ) are // also added .
func CreateCertPool(caCert string) (*x509.CertPool, error) {
	pool := x509.NewCertPool()
	if caCert != "" {
		xcert, err := cert.ParseCert(caCert)
		if err != nil {
			return nil, errors.Annotatef(err, "cannot parse certificate %q", caCert)
		}
		pool.AddCert(xcert)
	}
	count := processCertDir(pool)
	if count >= 0 {
		logger.Debugf("added %d certs to the pool from %s", count, certDir)
	}
	return pool, nil
}
func CreateCertPool ( caCert string ) ( * x509 . CertPool , error ) { pool := x509 . NewCertPool ( ) if caCert != " " { xcert , err := cert . ParseCert ( caCert ) if err != nil { return nil , errors . Annotatef ( err , " " , caCert ) } pool . AddCert ( xcert ) } count := processCertDir ( pool ) if count >= 0 { logger . Debugf ( " " , count , certDir ) } return pool , nil }
CreateCertPool creates a new x509.CertPool and adds in the caCert passed
in.
CreateCertPool creates a new x509 . CertPool and adds in the caCert passed in .