From dce019966ece078e11da357f0d3019d417fdb53d Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Sun, 16 Nov 2008 15:06:10 +0000 Subject: [PATCH] A workaround for 'missing algorithm' error during handshake --- .../java/org/jboss/netty/handler/ssl/SslHandler.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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: