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; } }
@Override public void sessionClosed(NextFilter nextFilter, IoSession session) throws SSLException { SslHandler handler = getSslSessionHandler(session); try { synchronized (handler) { // release resources handler.destroy(); } handler.flushScheduledEvents(); } finally { // notify closed session nextFilter.sessionClosed(session); } }
/** * Stops the SSL session by sending TLS <tt>close_notify</tt> message to * initiate TLS closure. * * @param session the {@link IoSession} to initiate TLS closure * @throws SSLException if failed to initiate TLS closure * @throws IllegalArgumentException if this filter is not managing the specified session */ public WriteFuture stopSsl(IoSession session) throws SSLException { SslHandler handler = getSslSessionHandler(session); NextFilter nextFilter = (NextFilter) session.getAttribute(NEXT_FILTER); WriteFuture future; synchronized (handler) { future = initiateClosure(nextFilter, session); } handler.flushScheduledEvents(); return future; }
/** * Stops the SSL session by sending TLS <tt>close_notify</tt> message to * initiate TLS closure. * * @param session the {@link IoSession} to initiate TLS closure * @return The Future for the initiated closure * @throws SSLException if failed to initiate TLS closure */ public WriteFuture stopSsl(IoSession session) throws SSLException { SslHandler sslHandler = getSslSessionHandler(session); NextFilter nextFilter = (NextFilter) session.getAttribute(NEXT_FILTER); WriteFuture future; try { synchronized (sslHandler) { future = initiateClosure(nextFilter, session); } sslHandler.flushScheduledEvents(); } catch (SSLException se) { sslHandler.release(); throw se; } return future; }
/** * Stops the SSL session by sending TLS <tt>close_notify</tt> message to * initiate TLS closure. * * @param session the {@link IoSession} to initiate TLS closure * @return The Future for the initiated closure * @throws SSLException if failed to initiate TLS closure */ public WriteFuture stopSsl(IoSession session) throws SSLException { SslHandler sslHandler = getSslSessionHandler(session); NextFilter nextFilter = (NextFilter) session.getAttribute(NEXT_FILTER); WriteFuture future; try { synchronized (sslHandler) { future = initiateClosure(nextFilter, session); } sslHandler.flushScheduledEvents(); } catch (SSLException se) { sslHandler.release(); throw se; } return future; }
/** * (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; }
@Override public void filterClose(final NextFilter nextFilter, final IoSession session) throws SSLException { SslHandler handler = (SslHandler) session.getAttribute(SSL_HANDLER); if (handler == null) { // The connection might already have closed, or // SSL might have not started yet. nextFilter.filterClose(session); return; } WriteFuture future = null; try { synchronized (handler) { if (isSslStarted(session)) { future = initiateClosure(nextFilter, session); future.addListener(new IoFutureListener<IoFuture>() { public void operationComplete(IoFuture future) { nextFilter.filterClose(session); } }); } } handler.flushScheduledEvents(); } finally { if (future == null) { nextFilter.filterClose(session); } } }
sslHandler.flushScheduledEvents(); } catch (SSLException se) { sslHandler.release();
sslHandler.flushScheduledEvents(); } catch (SSLException se) { sslHandler.release();
sslHandler.flushScheduledEvents(); } catch (SSLException se) { sslHandler.release();
sslHandler.flushScheduledEvents(); } catch (SSLException se) { sslHandler.release();
sslHandler.flushScheduledEvents();
sslHandler.flushScheduledEvents();
handler.flushScheduledEvents();
handler.flushScheduledEvents();