@SuppressWarnings("UnusedVariable")
    private boolean verifyHostName(String hostName, X509Certificate certificate) {
        hostName = hostName.toLowerCase(Locale.US);
        boolean hasDns = false;
        List<String> altNames = getSubjectAltNames(certificate, ALT_DNS_NAME);
        for (int i = 0, size = altNames.size(); i < size; i++) {
            hasDns = true;
            if (verifyHostName(hostName, altNames.get(i))) {
                return true;
            }
        }
        return false;
    }
Returns true if {@code certificate} matches {@code hostName}.
common/src/main/java/org/conscrypt/OkHostnameVerifier.java