When connecting to an SSL/TLS site and at the same time using the nopoll_loop_wait() event loop there is a race condition between the event loop waking up and reading from the socket and the SSL_Connect() loop. If the event loop reads the socket first, before SSL_Connect() is done with the ssl handshake the ssl handshake to fails.
This patch is an attempt at fixing that race condition by introducing a check so that the event loop is not listening on ssl sockets before the ssl handshake is done.
When connecting to an SSL/TLS site and at the same time using the nopoll_loop_wait() event loop there is a race condition between the event loop waking up and reading from the socket and the SSL_Connect() loop. If the event loop reads the socket first, before SSL_Connect() is done with the ssl handshake the ssl handshake to fails.
This patch is an attempt at fixing that race condition by introducing a check so that the event loop is not listening on ssl sockets before the ssl handshake is done.