certauth.go
func (a *Auth) ValidateCN(verifiedCert *x509.Certificate) error {
	var failed []string

	for _, cn := range a.opt.AllowedCNs {
		if cn == verifiedCert.Subject.CommonName {
			return nil
		}
		failed = append(failed, verifiedCert.Subject.CommonName)
	}
	return fmt.Errorf("cert failed CN validation for %v, Allowed: %v", failed, a.opt.AllowedCNs)
}
func (a *Auth) ValidateCN(verifiedCert *x509.Certificate) error {
	var failed []string

	for _, cn := range a.opt.AllowedCNs {
		if cn == verifiedCert.Subject.CommonName {
			return nil
		}
		failed = append(failed, verifiedCert.Subject.CommonName)
	}
	return fmt.Errorf("cert failed CN validation for %v, Allowed: %v", failed, a.opt.AllowedCNs)
}
// ValidateCN checks the CN of a verified peer cert and raises a 403 if the CN doesn't match any CN in the AllowedCNs list.