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 ba8264e401..705144a25e 100644 --- a/src/main/java/org/jboss/netty/handler/ssl/SslHandler.java +++ b/src/main/java/org/jboss/netty/handler/ssl/SslHandler.java @@ -624,7 +624,14 @@ public class SslHandler extends FrameDecoder { try { loop: for (;;) { - SSLEngineResult result = engine.unwrap(inNetBuf, outAppBuf); + SSLEngineResult result; + if (handshaking) { + synchronized (handshakeLock) { + result = engine.unwrap(inNetBuf, outAppBuf); + } + } else { + result = engine.unwrap(inNetBuf, outAppBuf); + } switch (result.getHandshakeStatus()) { case NEED_UNWRAP: