mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Lecharny (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DIRMINA-645) SslFilter should start initiating handshake from sesionCreated() rather than from onPostAdd()
Date Fri, 05 Oct 2012 23:08:03 GMT

    [ https://issues.apache.org/jira/browse/DIRMINA-645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13470771#comment-13470771

Emmanuel Lecharny commented on DIRMINA-645:

Clearly, we can't initialize the SslHandler in the SessionCreated event, because this can
be too late..

I do think that the initial proposal (ie, moving the SslFilter initialization in the sessionCreated
event) is not good. In the initial case, it's still possible to initialize the SslFilter *after*
the proxyFilter has been started, it's just a matter to add the SslFilter in the sessionCreated

I will revert the modification to come back to what we had in 2.0.4 : the SslFilter will be
initialized in the PostAdd event.
> SslFilter should start initiating handshake from sesionCreated() rather than from onPostAdd()
> ---------------------------------------------------------------------------------------------
>                 Key: DIRMINA-645
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-645
>             Project: MINA
>          Issue Type: Improvement
>          Components: Filter
>    Affects Versions: 2.0.0-M3
>            Reporter: Dan Mihai Dumitriu
>             Fix For: 2.0.5
>   Original Estimate: 1h
>  Remaining Estimate: 1h
> Here's the situation I needed to get working.  We want to make a secure connection through
a SOCKS 5 proxy.  So, one would think that just using the SslFilter and and the ProxyConnector
(which adds the ProxyFilter at the bottom of the stack) would just do it.  Unfortunately,
it does not work quite right out of the box.  The ProxyFilter only fully initializes itself
after the sessionCreated() method is called.  Meanwhile, the SslFilter tries to start the
handshake (i.e. calls initiateHandshake()) from the onPostAdd() method, which occurs before
the sessionCreated() is called.
> Moving the initiateHandshake() from onPostAdd() to sessionCreated() in SslFilter, as
shown below, seems to fix the problem.
>     @Override
>     public void onPostAdd(IoFilterChain parent, String name,
>             NextFilter nextFilter) throws SSLException {
> //        if (autoStart) {
> //            initiateHandshake(nextFilter, parent.getSession());
> //        }
>     }
>     @Override
> 	public void sessionCreated(NextFilter nextFilter, IoSession session)
> 			throws Exception {
>     	super.sessionCreated(nextFilter, session);
>     	if (autoStart) {
>             initiateHandshake(nextFilter, session);
>         }
> 	}

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message