public List<X509Certificate> getTrustedChainForServer(X509Certificate[] certs,
            String authType, SSLEngine engine) throws CertificateException {
        SSLSession session = engine.getHandshakeSession();
        if (session == null) {
            throw new CertificateException("Not in handshake; no session available");
        }
        return checkTrusted(certs, authType, session, engine.getSSLParameters(),
                false /* client auth */);
    }
Returns the full trusted certificate chain found from {@code certs}.
<p>
Throws {@link CertificateException} when no trusted chain can be found from {@code certs}.
common/src/main/java/org/conscrypt/TrustManagerImpl.java