F-5776: set connectionClosed on all WolfSSLSocket.close() paths

pull/389/head
Chris Conlon 2026-07-22 15:40:46 -06:00
parent 844c9a9013
commit 83d5e683ea
1 changed files with 6 additions and 2 deletions

View File

@ -2138,8 +2138,6 @@ public class WolfSSLSocket extends SSLSocket {
WolfSSLDebug.log(getClass(), WolfSSLDebug.INFO,
() -> "thread got handshakeLock");
this.connectionClosed = true;
/* Release native verify callback (JNI global) */
if (this.EngineHelper != null) {
this.EngineHelper.unsetVerifyCallback();
@ -2216,6 +2214,12 @@ public class WolfSSLSocket extends SSLSocket {
}
}
/* Mark closed on every teardown path, before clearing
* EngineHelper, so a later startHandshake() won't NPE. */
synchronized (handshakeLock) {
this.connectionClosed = true;
}
/* Reset internal WolfSSLEngineHelper to null */
if (this.EngineHelper != null) {
this.EngineHelper.clearObjectState();