error, or it could simply mean that server has sent all the data that it wants to send and has indicated that it has finished by sending a &quot;close_notify&quot; alert. This alert is a TLS protocol level message indicating that the endpoint has finished sending all of its data and it will not send any more. Both of these conditions result in a 0 return value from <a href="../man3/SSL_read_ex.html">SSL_read_ex(3)</a> and we need to use the function <a href="../man3/SSL_get_error.html">SSL_get_error(3)</a> 