public List<X509Certificate> checkServerTrusted(X509Certificate[] chain, String authType,
            SSLSession session) throws CertificateException {
        return checkTrusted(chain, authType, session, null, false /* client auth */);
    }
Validates whether a server is trusted. If session is given and non-null
it also checks if chain is pinned appropriately for that peer host. If
null, it does not check for pinned certs. The return value is a list of
the certificates used for making the trust decision.
common/src/main/java/org/conscrypt/TrustManagerImpl.java