private static SSLCapabilities exploreHandshake(
            ByteBuffer input, byte recordMajorVersion,
            byte recordMinorVersion, int recordLength) throws IOException {

        // What is the handshake type?
        byte handshakeType = input.get();
        if (handshakeType != 0x01) {   // 0x01: client_hello message
            throw new IllegalStateException("Not initial handshaking");
        }

        // What is the handshake body length?
        int handshakeLength = getInt24(input);

        // Theoretically, a single handshake message might span multiple
        // records, but in practice this does not occur.
        if (handshakeLength > (recordLength - 4)) { // 4: handshake header size
            throw new SSLException("Handshake message spans multiple records");
        }

        input = input.duplicate();
        input.limit(handshakeLength + input.position());
        return exploreClientHello(input,
                                    recordMajorVersion, recordMinorVersion);
    }
Launch and explore the security capabilities from byte array.
<P>
Please NOTE that this method must be called before any handshaking
occurs.  The behavior of this method is not defined in this release
if the handshake has begun, or has completed.  Once handshake has
begun, or has completed, the security capabilities can not and
should not be launched with this method.

@param  source
        a byte array containing inbound or outbound network data for
        an SSL/TLS connection.
@param  offset
        the start offset in array {@code source} at which the
        network data is read from.
@param  length
        the maximum number of bytes to read.

@throws IOException on network data error
@throws BufferUnderflowException if not enough source bytes available
        to make a complete exploration.
@return the explored {@link SSLCapabilities} of the SSL/TLS
        connection

@see #explore(ByteBuffer)
src/main/java/core/packetproxy/common/SSLExplorer.java