private void renegotiateIfNeeded(NextFilter nextFilter, SSLEngineResult res) throws SSLException { if ((res.getStatus() != SSLEngineResult.Status.CLOSED) && (res.getStatus() != SSLEngineResult.Status.BUFFER_UNDERFLOW) && (res.getHandshakeStatus() != SSLEngineResult.HandshakeStatus.NOT_HANDSHAKING)) { // Renegotiation required. handshakeComplete = false; handshakeStatus = res.getHandshakeStatus(); handshake(nextFilter); } }
private void renegotiateIfNeeded(NextFilter nextFilter, SSLEngineResult res) throws SSLException { if ((res.getStatus() != SSLEngineResult.Status.CLOSED) && (res.getStatus() != SSLEngineResult.Status.BUFFER_UNDERFLOW) && (res.getHandshakeStatus() != SSLEngineResult.HandshakeStatus.NOT_HANDSHAKING)) { // Renegotiation required. handshakeComplete = false; handshakeStatus = res.getHandshakeStatus(); handshake(nextFilter); } }
private void renegotiateIfNeeded(NextFilter nextFilter, SSLEngineResult res) throws SSLException { if (res.getStatus() != SSLEngineResult.Status.CLOSED && res.getStatus() != SSLEngineResult.Status.BUFFER_UNDERFLOW && res.getHandshakeStatus() != SSLEngineResult.HandshakeStatus.NOT_HANDSHAKING) { // Renegotiation required. handshakeComplete = false; handshakeStatus = res.getHandshakeStatus(); handshake(nextFilter); } }
private void initiateHandshake(NextFilter nextFilter, IoSession session) throws SSLException { SslHandler handler = getSslSessionHandler(session); synchronized (handler) { handler.handshake(nextFilter); } handler.flushScheduledEvents(); }
private void initiateHandshake(NextFilter nextFilter, IoSession session) throws SSLException { LOGGER.debug("{} : Starting the first handshake", getSessionInfo(session)); SslHandler sslHandler = getSslSessionHandler(session); try { synchronized (sslHandler) { sslHandler.handshake(nextFilter); } sslHandler.flushScheduledEvents(); } catch (SSLException se) { sslHandler.release(); throw se; } }
private void initiateHandshake(NextFilter nextFilter, IoSession session) throws SSLException { LOGGER.debug("{} : Starting the first handshake", getSessionInfo(session)); SslHandler sslHandler = getSslSessionHandler(session); try { synchronized (sslHandler) { sslHandler.handshake(nextFilter); } sslHandler.flushScheduledEvents(); } catch (SSLException se) { sslHandler.release(); throw se; } }
/** * Call when data read from net. Will perform inial hanshake or decrypt provided * Buffer. * Decrytpted data reurned by getAppBuffer(), if any. * * @param buf buffer to decrypt * @param nextFilter Next filter in chain * @throws SSLException on errors */ public void messageReceived(NextFilter nextFilter, ByteBuffer buf) throws SSLException { // append buf to inNetBuffer if (inNetBuffer == null) { inNetBuffer = IoBuffer.allocate(buf.remaining()).setAutoExpand(true); } inNetBuffer.put(buf); if (!handshakeComplete) { handshake(nextFilter); } else { decrypt(nextFilter); } if (isInboundDone()) { // Rewind the MINA buffer if not all data is processed and inbound is finished. int inNetBufferPosition = inNetBuffer == null? 0 : inNetBuffer.position(); buf.position(buf.position() - inNetBufferPosition); inNetBuffer = null; } }
handshake(nextFilter); } else {
/** * (Re)starts SSL session for the specified <tt>session</tt> if not started yet. * Please note that SSL session is automatically started by default, and therefore * you don't need to call this method unless you've used TLS closure. * * @return <tt>true</tt> if the SSL session has been started, <tt>false</tt> if already started. * @throws SSLException if failed to start the SSL session */ public boolean startSsl(IoSession session) throws SSLException { SslHandler handler = getSslSessionHandler(session); boolean started; synchronized (handler) { if (handler.isOutboundDone()) { NextFilter nextFilter = (NextFilter) session .getAttribute(NEXT_FILTER); handler.destroy(); handler.init(); handler.handshake(nextFilter); started = true; } else { started = false; } } handler.flushScheduledEvents(); return started; }
handshake(nextFilter); } else {
sslHandler.destroy(); sslHandler.init(); sslHandler.handshake(nextFilter); started = true; } else {
sslHandler.destroy(); sslHandler.init(); sslHandler.handshake(nextFilter); started = true; } else {
handshake(nextFilter); } catch (SSLException ssle) { SSLException newSsle = new SSLHandshakeException("SSL handshake failed.");
handshake(nextFilter); } catch (SSLException ssle) { SSLException newSsle = new SSLHandshakeException("SSL handshake failed.");
handshake(nextFilter); } catch (SSLException ssle) { SSLException newSsle = new SSLHandshakeException(