4

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.

1 Answer 1

5

Netty has examples :-)

Netty Master https://github.com/netty/netty/tree/master/example/src/main/java/io/netty/example/http/websocketx/sslserver

Netty 3.x Branch https://github.com/netty/netty/tree/3/src/main/java/org/jboss/netty/example/http/websocketx/sslserver

Sign up to request clarification or add additional context in comments.

2 Comments

these links do not exist anymore

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.