> Hi All!
>
> I've have some doubts regarding SSL_write in non blocking mode..
>
> 1. if SSL_write returned SSL_ERROR_WANT_WRITE,  it is mentioned that the
> call has to be repeated with the same arguments.
>     Does this means the same buffer to be used again?? or the data
> passed in the initial SSL_write call
>     will be buffered by the SSL layer?

The arguments must be exactly the same in the default mode. If you set
'accept moving write buffer' (which you should) then only the data needs to
be the same, the pointer can be different.

> 2.  In case of SSL_write returning SSL_ERROR_WANT_READ due to
> re-negotiation, What are the steps to be followed?

It depends what you want to do. All you know is that the state of the SSL
connection is "data must be read from the socket before a read of
application data will succeed".

>      Is there any wait needed before the repeated SSL_write call?

That's up to you. You can call SSL_write immediately again if you want, but
it is unlikely to succeed and will probably waste some CPU. But it's legal.

>      Does the application need to take care of the re-negotiation?

Yes and no. Then OpenSSL library will not do anything unless you tell it to.
But you don't have to call any special "do the re-negotiation" function. In
fact, technically, you don't really know it's negotiation that's needed. All
you know is that *something* is needed. When you call SSL_read or SSL_write,
it will do whatever's needed, whether or not that's a re-negotiation.

>      Does the application need to wait for the re-negotiation to
> complete before repeating the SSL_write?

If it does, it will be waiting a long time. Since OpenSSL can't do anything
until the application calls one of its functions.

DS


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

Reply via email to