// GetCertificates returns the given certificates as a certificate pool
GetCertificates returns the given certificates as a certificate pool
// GetCertificates returns the given certificates as a certificate pool
func GetCertificates(certs map[string]string) ([]*x509.Certificate, error) {
	certificates := []*x509.Certificate{}
	for k, cert := range certs {
		block, _ := pem.Decode([]byte(cert))
		cert, err := x509.ParseCertificate(block.Bytes)
		if err != nil {
			return nil, fmt.Errorf("could not parse '%s' certificate: %w", k, err)
		}
		log.Printf("added cert: %s - %s", k, cert.Subject)
		certificates = append(certificates, cert)
	}
	return certificates, nil
}
func GetCertificates ( certs map [ string ] string ) ( [ ] * x509 . Certificate , error ) { certificates := [ ] * x509 . Certificate { } for k , cert := range certs { block , _ := pem . Decode ( [ ] byte ( cert ) ) cert , err := x509 . ParseCertificate ( block . Bytes ) if err != nil { return nil , fmt . Errorf ( " " , k , err ) } log . Printf ( " " , k , cert . Subject ) certificates = append ( certificates , cert ) } return certificates , nil }
GetCertificates returns the given certificates as a certificate pool
GetCertificates returns the given certificates as a certificate pool