Hi,
Your documentation for read indicates that at most 16kb may be read in one call to ssl.read(), so it is necessary to call it multiple times when reading a stream larger than this size. I didn't see anything similar for write(), so when I tried to push a large packet through the write I got a variety of errors (the details below may not be precisely right because I am using my faulty memory):
1. For sizes just above 16384 bytes, the write went through.
2. For sizes around 17KB bytes, I got a message from Java saying that it had detected a stack-smashing attack.
3. For sizes around 100KB bytes, I got a segmentation fault within the JVM
4. For sizes around 1MB, bytes, my program just got a Seg fault 11 without any indication of what went wrong.
My workaround is simply to write 16384 bytes or less to every call of write(). Is there a different solution that I have missed? Is there any need to harden your Java interface code to return an exception or some other error indication? Do you need to update your documentation to say that some erroneous inputs will cause strange failures? Thanks.