[openssl-users] API SSL_Connect fails and always returns SSL_ERROR_WANT_READ causes infinite loop in application

Matt Caswell matt at openssl.org
Tue Nov 14 11:05:29 UTC 2017

On 14/11/17 10:44, mahesh gs wrote:

> if (EWOULDBLOCK == errno || EAGAIN == errno)
> {
>   /* Nothing to do, retry to connect again */
> }

This doesn't look right. If SSL_connect() fails due to an NBIO event
then you should get SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE back. If
you get SSL_ERROR_SYSCALL then something bad happened and you should not
retry. Could you add some logging here? I'm wondering whether you are
ending up here but missing it and looping around again.


More information about the openssl-users mailing list