I am now trying to set up Netty with a 2 way SSL handshake, where both the client and server present and verify certificates.
This does not appear to be implemented in SslHandler. Has anyone does this? I suppose it would go in the SslHandler.handshake operation and be delegated to javax.net.ssl.SSLEngine?
Any hints/tips/pre-existing implementations?
Thanks!
ANSWER (stackoverflow won’t let me post it the normal way) I found that if I set the needClientAuth flag on the SSLEngine object before setting up my SslHandler, that takes care of the problem!
Here is the solution, based on the HttpSnoop server example from the netty project.
When setting up the client side pipeline, the ssl engine must be set as follows:
Then your SSLContext must be modified as follows to set up a trust store in addition to a keystore (SecureChatSslContextFactory):