public void handleExtendedOperation( LdapSession session, InternalExtendedRequest req ) throws Exception
{
LOG.info( "Handling StartTLS request." );
IoFilterChain chain = session.getIoSession().getFilterChain();
SslFilter sslFilter = ( SslFilter ) chain.get( "sslFilter" );
if( sslFilter == null )
{
sslFilter = new SslFilter( sslContext );
chain.addFirst( "sslFilter", sslFilter );
}
else
{
sslFilter.startSsl( session.getIoSession() );
}
InternalExtendedResponse res = new ExtendedResponseImpl( req.getMessageId() );
InternalLdapResult result = res.getLdapResult();
result.setResultCode( ResultCodeEnum.SUCCESS );