The following code is broken because there is a large (almost 1 second) pause between each request. I strongly suspect because the TLS sessions are not reused, and so the handshake is repeated.
Any ideas how to fix it? Do I need to dig into the SSLEngine stuff in order to get session reuse? (The client works fine on other servers.)
SSLContext context = SSLContext.getInstance("TLS");
context.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
SSLServerSocketFactory ssf = context.getServerSocketFactory();
SSLServerSocket servSocket = (SSLServerSocket) ssf.createServerSocket(5696);
servSocket.setWantClientAuth(true);
for (;;)
SSLSocket c = (SSLSocket) servSocket.accept();
