Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to read Response from TLS Server #5

Open
amanvj opened this issue Apr 16, 2020 · 0 comments
Open

Not able to read Response from TLS Server #5

amanvj opened this issue Apr 16, 2020 · 0 comments

Comments

@amanvj
Copy link

amanvj commented Apr 16, 2020

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant