Skip to content

Commit 9423567

Browse files
committed
do not return from startHandshake if handshakeInitCalled == true
1 parent c802d5c commit 9423567

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

src/java/com/wolfssl/provider/jsse/WolfSSLSocket.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,21 +1130,23 @@ synchronized public void startHandshake() throws IOException {
11301130
"entered startHandshake()");
11311131

11321132
synchronized (handshakeLock) {
1133-
if (handshakeInitCalled == true || handshakeComplete == true) {
1134-
/* handshake already started or finished */
1133+
if (handshakeComplete == true) {
1134+
/* handshake already finished */
11351135
return;
11361136
}
1137+
1138+
if (handshakeInitCalled == false) {
1139+
/* will throw SSLHandshakeException if session creation is
1140+
not allowed */
1141+
EngineHelper.initHandshake();
1142+
handshakeInitCalled = true;
1143+
}
11371144
}
11381145

11391146
synchronized (ioLock) {
11401147
WolfSSLDebug.log(getClass(), WolfSSLDebug.INFO,
11411148
"thread got ioLock (handshake)");
11421149

1143-
/* will throw SSLHandshakeException if session creation is
1144-
not allowed */
1145-
EngineHelper.initHandshake();
1146-
handshakeInitCalled = true;
1147-
11481150
try {
11491151
ret = EngineHelper.doHandshake(0, this.getSoTimeout());
11501152
} catch (SocketTimeoutException e) {

0 commit comments

Comments
 (0)