Skip to content

Not able to read Response from TLS Server #5

@amanvj

Description

@amanvj

i am using your code for TLS connection to connect from client to server using TLS protocol but

There is only one problem which i am facing is that i am unable to read Response from TLS server while TLS server is responding

on this line
int bytes=socketchannel.read(clientUnwrap);

i am getting bytes value 0

sometime i get an Exception when

engine.unwrap(clientUnwrap,serverUnwrap);

Exception in thread "main" javax.net.ssl.SSLException: bad record MAC
Caused by: javax.crypto.BadPaddingException: bad record MAC

working points -
1.i am able to connect to a device that is TLS Server.
2.i am able to write to a device that is TLS Server.

Not Working points -

  1. i am unable to read Response from a device that is TLS Server (why so)

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