You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2025/06/18 09:33:45 UTC
(httpcomponents-core) branch 5.3.x updated: HTTPCORE-782: non-blocking TLS session can end up in an endless loop in case of a protocol negotiation
This is an automated email from the ASF dual-hosted git repository.
olegk pushed a commit to branch 5.3.x
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git
The following commit(s) were added to refs/heads/5.3.x by this push:
new f6eaeeb44 HTTPCORE-782: non-blocking TLS session can end up in an endless loop in case of a protocol negotiation
f6eaeeb44 is described below
commit f6eaeeb449ee982d109e909ff24f602779fe576d
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Wed Jun 18 11:20:20 2025 +0200
HTTPCORE-782: non-blocking TLS session can end up in an endless loop in case of a protocol negotiation
---
.../main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java b/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
index f7887788a..a839d7ad4 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
@@ -620,10 +620,11 @@ private void decryptData(final IOSession protocolSession) throws IOException {
inPlainBuf.clear();
}
}
- if (result.getStatus() != SSLEngineResult.Status.OK) {
- if (result.getStatus() == SSLEngineResult.Status.BUFFER_UNDERFLOW && endOfStream) {
- throw new SSLException("Unable to decrypt incoming data due to unexpected end of stream");
- }
+ if (result.getStatus() == SSLEngineResult.Status.BUFFER_UNDERFLOW && endOfStream) {
+ throw new SSLException("Unable to decrypt incoming data due to unexpected end of stream");
+ }
+ if (result.getStatus() != SSLEngineResult.Status.OK ||
+ result.getHandshakeStatus() != HandshakeStatus.NOT_HANDSHAKING && result.getHandshakeStatus() != HandshakeStatus.FINISHED) {
break;
}
} finally {