diff --git a/certificate/certificates.go b/certificate/certificates.go index ff0e2d52..a1306802 100644 --- a/certificate/certificates.go +++ b/certificate/certificates.go @@ -540,10 +540,10 @@ func hasPreferredChain(issuer []byte, preferredChain string) (bool, error) { return false, err } - for _, cert := range certs { - if cert.Issuer.CommonName == preferredChain { - return true, nil - } + topCert := certs[len(certs)-1] + + if topCert.Issuer.CommonName == preferredChain { + return true, nil } return false, nil