Sorry, I actually haven't been using that part of OpenSSL
myself, so I don't know the details, but Michael Smith
has offered to help you, could you ask him?

What I have read elsewhere seems to be something like:

When using "non-blocking" sockets mode, SSL_read(),
SSL_write() etc. may return either of two special error
codes (by returning a negative number and causing
the next call to SSL_get_error() to return that code):

SSL_ERROR_WANT_READ:  pass the socket in the
fd_read argument to select, then try again when select()
says it is ready.

SSL_ERROR_WANT_WRITE:  pass the socket in the
fd_write argument to select, then try again when select()
says it is ready.

There are other similar return values to wait for the
connect/accept socket operation, see the documentation
for SSL_get_error() for details.


On 1/9/2012 1:53 AM, Nathan Smyth wrote:
Or perhaps, more specifically, any examples to address the following.  As I 
seem to be getting deadlocks :(

Per the OpenSSL FAQ: http://www.openssl.org/support/faq.html#PROG10
A pitfall to avoid: Don't assume that SSL_read() will just read from
the underlying transport or that SSL_write() will just write to it --
it is also possible that SSL_write() cannot do any useful work until
there is data to read, or that SSL_read() cannot do anything until it
is possible to send data.  One reason for this is that the peer may
request a new TLS/SSL handshake at any time during the protocol,
requiring a bi-directional message exchange; both SSL_read() and SSL_write() will try to continue any pending handshake.
Thanks!


----- Original Message -----
From: Nathan Smyth<naf...@ymail.com>
To: "openssl-users@openssl.org"<openssl-users@openssl.org>
Cc:
Sent: Sunday, 8 January 2012, 22:45
Subject: Re: socket functions on fds

Pay special attention to the fact that sometimes an OpenSSL
call to send or recv will ask you to wait (select) for it's own
direction to be ready, sometimes for the other direction to be
ready, depending on internal OpenSSL states.
Selects before the SSL_read/writes?

Any chance of a link to an example, or even some specific search terms?

Thanks!!
______________________________________________________________________
OpenSSL Project                                http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                          majord...@openssl.org

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to