SSL_read() on client blocks even after select() returns with readable server socket

I am building a TLS client using C to connect to a secure server usint TLS 1.3.

I have created a blocking (regular) TCP socket.And then connect to the remote secure server. Also I have created and configured SSL context and linked the server socket to SSL object (SSL_set_fd()). My SSL_connect() is successfull and I am able to send/receive data from the remote server.

The problem I am facing is, I have a event loop, where I am doing multiple SSL_write() and have a select() to monitor the socket for incomming data from server. However, in every iteration of the event loop thel select() returns readable socket, and SSL_read() blocks.

Why does he SSL_read(( is unable to read even though select() tags the socket ready to read?



Read more here: https://stackoverflow.com/questions/66330913/ssl-read-on-client-blocks-even-after-select-returns-with-readable-server-soc

Content Attribution

This content was originally published by Anirban at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: