static NativeSslSession newInstance(NativeRef.SSL_SESSION ref, ConscryptSession session)
            throws SSLPeerUnverifiedException {
        AbstractSessionContext context = (AbstractSessionContext) session.getSessionContext();
        if (context instanceof ClientSessionContext) {
            return new Impl(context, ref, session.getPeerHost(), session.getPeerPort(),
                session.getPeerCertificates(), getOcspResponse(session),
                session.getPeerSignedCertificateTimestamp());
        }

        // Server's will be cached by ID and won't have any of the extra fields.
        return new Impl(context, ref, null, -1, null, null, null);
    }
Creates a new instance. Since BoringSSL does not provide an API to get access to all
session information via the SSL_SESSION, we get some values (e.g. peer certs) from
the {@link ConscryptSession} instead (i.e. the SSL object).
common/src/main/java/org/conscrypt/NativeSslSession.java