diff --git a/src/main/java/org/jboss/netty/handler/ssl/SslHandler.java b/src/main/java/org/jboss/netty/handler/ssl/SslHandler.java index 786f234542..14f58d93e4 100644 --- a/src/main/java/org/jboss/netty/handler/ssl/SslHandler.java +++ b/src/main/java/org/jboss/netty/handler/ssl/SslHandler.java @@ -273,14 +273,13 @@ public class SslHandler extends FrameDecoder { if (handshaking) { return this.handshakeFuture; } else { + engine.beginHandshake(); handshakeFuture = this.handshakeFuture = newHandshakeFuture(channel); handshaking = true; } } - ChannelHandlerContext ctx = context(channel); - engine.beginHandshake(); - wrapNonAppData(ctx, channel); + wrapNonAppData(context(channel), channel); return handshakeFuture; }