Question

I want to use netty for websockets with TLS enabled and using the (wss://) schema.

So I figured I should work like this: the WebSocketServerHandler should now extend theSslHandler. So I basically only have to set up an SSLEngine wihin the WebSocketServerPipelineFactory. I can than pass the engine to the secure handler:

SSLEngine sslEngine = SSLContext.getDefault().createSSLEngine();
pipeline.addLast("handler", new WebSocketServerHandler(sslEngine));

Is this approach in general the right one and (if the approach is correct) - how do I set up the SSLEngine (I've my certificate & private/public keys as files available). I couldn't find any example!

Thanks.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top