Я пытаюсь запустить последний пример Netty Draft10 поверх SSL (WSS)
https://github.com/netty/netty/tree/master/src/main/java/org/jboss/netty/example/http/websocketx/server
Я использую следующую конфигурацию порта:
Порт: 80: Apache non ssl
Порт: 443: Apache ssl
Порт: 8080: Tomcat
Порт: 8877: Netty Web не SS
Порт: 9977: Netty SSL
Но когда я встраиваю код обработчика SSL
public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
//TODO - Tamir - Add support for Wss
// Get the SslHandler in the current pipeline.
// We added it in SecureChatPipelineFactory.
final SslHandler sslHandler = ctx.getPipeline().get(SslHandler.class);
// Get notified when SSL handshake is done.
ChannelFuture handshakeFuture = sslHandler.handshake();
handshakeFuture.addListener(new Greeter(sslHandler));
}
в класс WebSocketServerHandler, я получаю сообщение об ошибке
java.lang.IllegalArgumentException: empty text
at org.jboss.netty.handler.codec.http.HttpVersion.<init>(HttpVersion.java:95)
at org.jboss.netty.handler.codec.http.HttpVersion.valueOf(HttpVersion.java:68)
at org.jboss.netty.handler.codec.http.HttpRequestDecoder.createMessage(HttpRequestDecoder.java:81)
at org.jboss.netty.handler.codec.http.HttpMessageDecoder.decode(HttpMessageDecoder.java:198)
at org.jboss.netty.handler.codec.http.HttpMessageDecoder.decode(HttpMessageDecoder.java:107)
at org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:470)
at org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:443)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:275)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:262)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:340)
at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:271)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:191)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
java.lang.IllegalArgumentException: invalid version format: ?_?_?__
Это мой код конвейера
SSLEngine engine =
SecureChatSslContextFactory.getServerContext().createSSLEngine();
engine.setUseClientMode(false);
pipeline.addLast("ssl", new SslHandler(engine));
// On top of the SSL handler, add the text line codec.
pipeline.addLast("decoder", new StringDecoder());
pipeline.addLast("encoder", new StringEncoder());
// and then business logic.
pipeline.addLast("handler", new WebSocketServerHandler());
Anyидеи?
Ура,
Тамир