this.handshakeLatch = handshakeLatch;
}
@Override
public void onConnect(IOEvent<Context> ioEvent) {
SSLConnectorHandler sslConnectorHandler =
(SSLConnectorHandler) this.connectorHandler;
SelectionKey key = ioEvent.attachment().getSelectionKey();
try {
sslConnectorHandler.finishConnect(key);
WorkerThread workerThread =
(WorkerThread) Thread.currentThread();
workerThread.setSSLEngine(sslConnectorHandler.getSSLEngine());
ThreadAttachment attachment =
workerThread.updateAttachment(Mode.SSL_ENGINE);
key.attach(attachment);
handshakeAppBuffer = acquireBuffer();
boolean shake =
sslConnectorHandler.handshake(handshakeAppBuffer, true);
if (shake) {
ioEvent.attachment().getSelectorHandler().register(key,
SelectionKey.OP_READ);
} else {
ioEvent.attachment().getSelectorHandler().