@SuppressLint("NewApi") // AbstractConscryptSocket defines getHandshakeSession()
    public static void checkClientTrusted(X509TrustManager tm, X509Certificate[] chain,
            String authType, ConscryptEngine engine) throws CertificateException {
        if (!checkTrusted("checkClientTrusted", tm, chain, authType, SSLEngine.class, engine)
                && !checkTrusted("checkClientTrusted", tm, chain, authType, String.class,
                           engine.getHandshakeSession().getPeerHost())) {
            tm.checkClientTrusted(chain, authType);
        }
    }
Helper function to unify calls to the different names used for each function taking a
Socket, SSLEngine, or String (legacy Android).
android/src/main/java/org/conscrypt/Platform.java