[NO ISSUE][NET] Attempt to Read SSL Sockets Until EOF

- user model changes: no
- storage format changes: no
- interface changes: no

Details:

- Since SSL sockets may return 0 as read bytes due to failure
  to decrypt a complete encrypted block, we need to attempt
  to read again until a complete block is decrypted.

Change-Id: Ia48b7f9f1725c40b2ebfac6fe77b3eb42c426de3
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/15964
Reviewed-by: Ali Alsuliman <ali.al.solaiman@gmail.com>
Tested-by: Murtadha Hubail <mhubail@apache.org>
diff --git a/asterixdb/asterix-replication/src/main/java/org/apache/asterix/replication/management/NetworkingUtil.java b/asterixdb/asterix-replication/src/main/java/org/apache/asterix/replication/management/NetworkingUtil.java
index 8162e0a..b38f0aa 100644
--- a/asterixdb/asterix-replication/src/main/java/org/apache/asterix/replication/management/NetworkingUtil.java
+++ b/asterixdb/asterix-replication/src/main/java/org/apache/asterix/replication/management/NetworkingUtil.java
@@ -49,7 +49,7 @@
         byteBuffer.clear();
         byteBuffer.limit(length);
 
-        while (byteBuffer.remaining() > 0 && socketChannel.read(byteBuffer) > 0);
+        while (byteBuffer.remaining() > 0 && socketChannel.read(byteBuffer) >= 0);
 
         if (byteBuffer.remaining() > 0) {
             throw new EOFException("could not read all data from source; remaining bytes: " + byteBuffer.remaining());