Skip to content

Unwrap does not read from the socket again #2

@indvamshi

Description

@indvamshi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions