JSSE: send shutdown alert when doHandshake() rejects new session

pull/363/head
Chris Conlon 2026-04-30 16:35:49 -06:00
parent 222f5b9bf1
commit 2039266faa
1 changed files with 8 additions and 1 deletions

View File

@ -1696,7 +1696,7 @@ public class WolfSSLEngineHelper {
/* send CloseNotify */
/* TODO: SunJSSE sends a Handshake Failure alert instead here */
this.ssl.shutdownSSL();
} catch (SocketException e) {
} catch (SocketException | SocketTimeoutException e) {
throw new SSLException(e);
}
@ -1712,6 +1712,13 @@ public class WolfSSLEngineHelper {
WolfSSLDebug.log(getClass(), WolfSSLDebug.INFO,
() -> "session creation not allowed");
try {
/* send CloseNotify so peer is not left hanging */
this.ssl.shutdownSSL();
} catch (SocketException | SocketTimeoutException e) {
throw new SSLException(e);
}
return WolfSSL.SSL_HANDSHAKE_FAILURE;
}