/** * Execute a non blocking SSL handshake. */ protected boolean doHandshake(int timeout) throws IOException{ HandshakeStatus handshakeStatus = HandshakeStatus.NEED_UNWRAP; boolean OK = true; final SSLWorkerThread workerThread = (SSLWorkerThread)Thread.currentThread(); try{ if ( handshake ) { byteBuffer = SSLUtils.doHandshake (key,byteBuffer,inputBB,outputBB,sslEngine, handshakeStatus,timeout); if (doRead(inputBB) == -1){ throw new EOFException(); } } } catch (EOFException ex) { Logger logger = SSLSelectorThread.logger(); if ( logger.isLoggable(Level.FINE) ){ logger.log(Level.FINE,"doHandshake",ex); } OK = false; } finally { workerThread.setOutputBB(outputBB); } return OK; }
workerThread.setOutputBB(outputBB); workerThread.setByteBuffer(byteBuffer);