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?