public void prepareHandshake() throws IOException {
        if (mEngine != null) {
            // The handshake was started.
            return;
        }
        SSLEngine engine = createEngine(mSSLEngineFactory);
        if (engine == null) {
            throw new SSLException("Failed to create client SSLEngine.");
        }
        ByteBuffer input = ByteBuffer.allocate(0);
        handshake(engine, input, new CodecCallback() {
            @Override
            public void onPending(ByteBuffer buffer) {
            }

            @Override
            public void onProcess(ByteBuffer buffer) {
            }

            @Override
            public void onEncrypt(ByteBuffer buffer) throws IOException {
                // Send to remote server
                mRequest.process(buffer);
            }

            @Override
            public void onDecrypt(ByteBuffer buffer) {
            }
        });
    }
Prepare and start SSL handshake with the remote server.

@throws IOException If an I/O error has occurred.
netbare-core/src/main/java/com/github/megatronking/netbare/ssl/SSLResponseCodec.java