javasslniohandshakesslengine

SSLEngine handshaking stuck after task


I use example from http://books.google.com/books?id=l6f1jTB_XCYC&lpg=PA185&vq=scalable%20secure&pg=PA185#v=onepage&q&f=false to see how SSLEngine works with SocketChannel. Later i wanted to create solution adapted to my implementation. Unfortunately, this example does not work. It's stuck after runDelegatedTasks() method executing. Server console output:

Server: listening at sun.nio.ch.ServerSocketChannelImpl[/0.0.0.0:12345]
Server: select count=1
Server: accepted java.nio.channels.SocketChannel[connected local=/127.0.0.1:12345 remote=/127.0.0.1:52793]
Server: select count=1
Server: reading
Server: read count=0 request=java.nio.HeapByteBuffer[pos=0 lim=16660 cap=16660]

Client console is empty.

Anyone can help with this example?


Solution

  • For completeness, the SSLEngineManager code in my book had a bug when used in client mode. The source code was updated shortly after publication and has been made available here until further notice.

    Esmond Pitt, author Fundamental Networking in Java.