Skip to content

Commit 7a50e0d

Browse files
Ali Farahaniok2c
authored andcommitted
Safe-guard for infinite unproductive loop in non-blocking SSLIOSession #527
1 parent 8d68290 commit 7a50e0d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,15 @@ private void decryptData(final IOSession protocolSession) throws IOException {
626626
}
627627
break;
628628
}
629+
if (result.bytesConsumed() == 0) {
630+
throw new SSLException(String.format("Unable to decrypt incoming data " +
631+
"[status = " + result.getStatus() +
632+
"; handshakeStatus = " + result.getHandshakeStatus() +
633+
"; bytesConsumed = " + result.bytesConsumed() +
634+
"; bytesProduced = " + result.bytesProduced() +
635+
"; end of stream = " + endOfStream +
636+
"]"));
637+
}
629638
} finally {
630639
inPlain.release();
631640
}

0 commit comments

Comments
 (0)