[ 
https://issues.apache.org/jira/browse/DIRMINA-645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Emmanuel Lecharny updated DIRMINA-645:
--------------------------------------

    Fix Version/s:     (was: 2.0.0-M4)
                   3.0.0-M1
       Issue Type: Improvement  (was: Bug)

Postponed to 3.0 version, as 2.0.0-M4 is already released, and moved from bug 
to improvement.

I think that the SSL handling should not be part of the filter chain, as it has 
nothing to do with the data being exchanged with the client. It should be put 
somewhere else in front of the chain.

> 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: 3.0.0-M1
>
>   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.
-
You can reply to this email to add a comment to the issue online.

Reply via email to