kllbzz commented on PR #41: URL: https://github.com/apache/mina/pull/41#issuecomment-1784200832
@elecharny > To be clear: as soon as the connection has been created, we need to initiate the handshake. This is the purpose of the **onPosAdd** method. If we don't do that, then the handshake will never be initiated anywhere. Can you please eleborate on this a bit more, I see that handshake is initiated in method `synchronized protected void onConnected(NextFilter next, IoSession session) throws SSLException` And onConnected method called from 2 places: 1. in method **onPosAdd**, which I removed `public void onPostAdd(IoFilterChain parent, String name, NextFilter next) throws Exception` 2. in method **sessionOpened** `public void sessionOpened(NextFilter next, IoSession session) throws Exception` https://github.com/apache/mina/blob/337246a2dcf700d453dd07b091d84d0f8b16a51f/mina-core/src/main/java/org/apache/mina/filter/ssl/SslFilter.java#L362 I thought that the way via **sessionOpened** can still initiates handshake as expected. At least this is what I see in my tests. Moreover existing code implies that handshake not always can be initiated in **onPostAdd** cause onConnected is called only if session is connected. > In your case, I guess the **ProxyFilter** instance does not have a proper **ProxyLogicHandler** attribute stored. There is most certainly some issue in the session initialization, like teh session is initialized twice. You still can be right. I'm not eperienced in mina code. But can you then point where my logic fails: according to the code **ProxyLogicHandler** installed only during event SessionCreated in ProxyFilter https://github.com/apache/mina/blob/337246a2dcf700d453dd07b091d84d0f8b16a51f/mina-core/src/main/java/org/apache/mina/proxy/filter/ProxyFilter.java#L278 But used in SslFilter during handshake during filter chain creation (before onCreated and onConnected events). Is this a contradiction? What I'm missing ? > > In any case, the proposed patch does not seems valid to me. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org