OpenSSL 0.9.6c, Windows98, Visual C++6.0.
A funny predicament. I'm creating a socket and setting it in the SSL system via SSL_set_fd() -- I'm not using BIOs. This is a very simple client to download a web-page from a server in a one-off, HTTP/1.0 manner.
I set my socket non-blocking, connect to the server, then setup SSL. I think my non-blocking behavior is correct -- making sure my select() actually finds anything useful before blasting away at the socket. Retrying my SSL operations in case of SSL_WANT_READ/WANT_WRITE/etc.
After my SSL_connect succeeds, I select() on the socket for writes because I want to send my request. After select() succeeds, I try an SSL_write() and it hangs, times out. But if I put a short sleep() command right after my select() succesfully finds the socket writeable, SSL_write() proceeds fine.
Clearly I'm in some race condition, but I don't know what else I'm supposed to be testing before I proceed with my write.
Help?
-- kov