@Override
    byte[] getChannelId() throws SSLException {
        synchronized (ssl) {
            if (getUseClientMode()) {
                throw new IllegalStateException("Not allowed in client mode");
            }

            if (isHandshakeStarted()) {
                throw new IllegalStateException(
                        "Channel ID is only available after handshake completes");
            }
            return ssl.getTlsChannelId();
        }
    }
Gets the TLS Channel ID for this server engine. Channel ID is only available once the
handshake completes.

@return channel ID or {@code null} if not available.

@throws IllegalStateException if this is a client engine or if the handshake has not yet
completed.
@throws SSLException if channel ID is available but could not be obtained.
common/src/main/java/org/conscrypt/ConscryptEngine.java