Asanka Kumara > 1. Called SSL_write with data 'abc' > 2 this returned SSL_ERROR_WANT_READ > 3. Wait on a 'select' until data arrives. > 4. Called SSL_read with this socket.
Why are you calling SSL_read? > 5. If SSL_read returns 'SSL_ERROR_NONE' or 'SSL_ERROR_WANT_READ' , then > call SSL_write with data 'abcdef' (i.e. 'abc' in step 1 plus some > more data) No matter what SSL_read returns, you should call SSL_write. The 'WANT_READ' error is invalidated as soon as data arrives at the socket. > So could anyone please answer > 1. Is above procedure wrong ? (If so then what is the correct procedure ?) It's fine, but why call SSL_read? If you want to write to the SSL connection, you should call SSL_write. SSL_read is for when you want to read from the SSL connection. It's OpenSSL's job to figure out whether these require reading from or writing to the socket. DS ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org