Hi could someone please point me in the right direction.

Im not exactly sure how to implement SSL encrypted connections in Mina.
 
 
 
I have two classes ReverseEchoServer and ReverseEchoServerHandler
 
Within ReverseEchoServer I have the following method which is called before registry.bind()


 private static void addSSLSupport( ServiceRegistry registry )

throws Exception {

SSLFilter sslFilter =

new SSLFilter( BogusSSLContextFactory.getInstance( true ) );

IoAcceptor acceptor =

registry.getIoAcceptor( TransportType.SOCKET );

acceptor.getFilterChain().addLast( "sslFilter", sslFilter );

System.out.println( "SSL ON" );

}

Within ReverseEchoServerHandler I have the following;

public void sessionCreated( IoSession session )  {

SessionConfig cfg = session.getConfig();

if( cfg instanceof SocketSessionConfig )

{

SocketSessionConfig scfg = ( ( SocketSessionConfig ) cfg ) ;

scfg.setSessionReceiveBufferSize( 2048 );

}

}

However when I try to connect to the socket the server accepts the connection but if i type anything into putty no logging occurs.

Is there something I need to do to initialize the SSL session from within the sessionCreated method?

Ive tried to reference the examples but the one that uses SSL doesn't compile with the newer versions of mina.

 

Thanks for any tips or help.

 

Phil


 

Reply via email to