Interleaving SSL_write() and SSL_read()

2013-09-19 Thread Krzysztof Kwiatkowski
Hi, I'm a bit confused about usage of SSL_write()/SSL_read() in non-blocking connectors. Let say I do SSL_write() and I get SSL_ERROR_WANT_WRITE. It means I have to do SSL_write() again. But does it mean that I can't do SSL_read() until SSL_write() returns with success? Any idea? Kris

Re: Interleaving SSL_write() and SSL_read()

2013-09-19 Thread James Marshall
My understanding is that yes, on that given socket, you have to do only what it needs according to the error code. In this case, SSL_ERROR_WANT_WRITE indicates you should select on write and try SSL_write() again before doing an SSL_read() on that socket. Of course, you can read and write on

Re: Interleaving SSL_write() and SSL_read()

2013-09-19 Thread Karthik Krishnamurthy
If SSL_read returns SSL_ERROR_WANT_READ, it is perfectly reasonable to go ahead and call SSL_write or the other way around. Otherwise, it would be impossible to do full-duplex SSL communication with OpenSSL. I recently ran into a host of similar questions (and issues) and I got most of my