I use a non blocking socket. For a normal TCP connect I do as in here: Non blocking socket - how to check if a connection was successful?
But for the SSL_connect call I cannot get it to work.
I understand it as I should: 1. Repeatedly call SSL_connect. 2. Check if SSL_get_error is SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE. 3. If so, then I am not 100% sure what to do next. Should I call SSL_connect until I don't get that? Or should I do as with a normal socket, check the socket with select using read_fds or write_fds and check with FD_ISSET and if so check getsockopt with SO_ERROR?
Basically, for SSL_connect and a non-blocking socket, what tells me that the connection has succeeded? I have looked at other examples but none are clear enough.
pollorselectapi according to operation result. And repeat operation. - Valeri AtamanioukSSL_connect. This function is not for lower-level connect operation, but for security protocol setup. - Valeri Atamaniouk