-
-
Save koush/ec35fd6683e0c36cc567 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/main/java/org/conscrypt/OpenSSLEngineImpl.java b/src/main/java/org/conscrypt/OpenSSLEngineImpl.java | |
index 01966c8..e6716d5 100644 | |
--- a/src/main/java/org/conscrypt/OpenSSLEngineImpl.java | |
+++ b/src/main/java/org/conscrypt/OpenSSLEngineImpl.java | |
@@ -415,6 +415,9 @@ public class OpenSSLEngineImpl extends SSLEngine implements NativeCrypto.SSLHand | |
if (sslSessionCtx != 0) { | |
sslSession = sslParameters.setupSession(sslSessionCtx, sslNativePointer, null, | |
getPeerHost(), getPeerPort(), true); | |
+ if (engineState == EngineState.HANDSHAKE_STARTED) { | |
+ engineState = EngineState.READY_HANDSHAKE_CUT_THROUGH; | |
+ } | |
} | |
int bytesWritten = handshakeSink.position(); | |
return new SSLEngineResult(Status.OK, getHandshakeStatus(), 0, bytesWritten); | |
@@ -514,6 +517,9 @@ public class OpenSSLEngineImpl extends SSLEngine implements NativeCrypto.SSLHand | |
if (sslSessionCtx != 0) { | |
sslSession = sslParameters.setupSession(sslSessionCtx, sslNativePointer, | |
null, null, getPeerPort(), true); | |
+ if (engineState == EngineState.HANDSHAKE_STARTED) { | |
+ engineState = EngineState.READY_HANDSHAKE_CUT_THROUGH; | |
+ } | |
} | |
} catch (Exception e) { | |
throw (SSLHandshakeException) new SSLHandshakeException("Handshake failed") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment