-
Notifications
You must be signed in to change notification settings - Fork 55
Description
Hi
I have gone through the code and I found that buffer underflow does not read the from the socket again. It only increases the buffer size.
Based on the documentation
https://docs.oracle.com/javase/7/docs/api/javax/net/ssl/SSLEngine.html
If the client reads partial data from the network, we need to force the client to read it again. But, its not happening with your code.
After debugging the code, when I force the logic to go into buffer underflow I get the following exception
Exception in thread "main" javax.net.ssl.SSLException: Unsupported record version Unknown-0.0
at sun.security.ssl.EngineInputRecord.bytesInCompletePacket(EngineInputRecord.java:117)
at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:862)
at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:775)
at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624)
Because the data read initially is reset in buffer underflow.
Can you please look into this if you have time.
Much appreciated.
Thanks
Vam