directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julien Vermillard <jvermill...@archean.fr>
Subject Re: [mina] SSLFilter race condition: Take #2
Date Thu, 13 Oct 2005 14:07:09 GMT
Le jeudi 13 octobre 2005 à 22:14 +0900, Trustin Lee a écrit :
> 
> What if a client initiates TLS handshake process before we call
> sslFilter.setEnable(true).  I know this won't happen easily, but it
> has possibility of race condition yet. 
> 
> I talked with Emmanuel and here's another option:
> 
> public void messageReceived(IoSession session, Object message) {
>     if (message instanceof MyStartTLSRequest) {
>         // insert SSLFilter to start handshaking 
>         session.getFilterChain().addFirst(sslFilter);
> 
>         // Disable encryption temporarilly.  This attribute will be
> cleared after Session.write()
>         session.setAttribute( SSLFilter.DISABLE_ENCRYPTION ,
> Boolean.TRUE );
> 
>         // write StartTLSResponse
>         session.write(new MyStartTLSResponse(OK));
>     }
> }
> 
> Trustin
I like the last solution, it keep the change localized to SSLFilter


Mime
View raw message