@Override
    public boolean verify(String hostname, SSLSession session) {
        try {
            X509Certificate cert = (X509Certificate) session.getPeerCertificates()[0];
            return isTrusted(AthenzIdentities.from(cert));
        } catch (SSLPeerUnverifiedException e) {
            log.log(Level.WARNING, "Unverified client: " + hostname);
            return false;
        }
    }
A {@link HostnameVerifier} that validates Athenz x509 certificates using the identity in the Common Name attribute.

@author bjorncs
vespa-athenz/src/main/java/com/yahoo/vespa/athenz/tls/AthenzIdentityVerifier.java