[openssl-users] Getting the retry reason for a "failed" BIO_write/BIO_read

Ajay Garg ajaygargnsit at gmail.com
Mon Oct 10 06:20:56 UTC 2016


Hi All.

Taking the socket-structure as ::

############################################################
#####################################
           SSL *ssl;

           BIO *ssl_bio;                 // app-payload-bytes will be
written by app into it.
           BIO *inter_bio;               // intermediate-bio, have no idea
what it really is used for.
           BIO *network_bio;          // app-payload-encrypted-bytes will
"emerge" from this bio, ready to be written over the wire
############################################################
#####################################




and assuming all initialization went fine, what is the correct way to get
the retry-reason ::

############################################################
#####################################
        if(BIO_should_retry(socket->ssl_bio) != 0)
        {
              int reason =  BIO_get_retry_reason(socket->ssl_bio);
        }

                                              OR

        if(BIO_should_retry(socket->ssl_bio) != 0)
        {
              int reason =
BIO_get_retry_reason(BIO_get_retry_BIO(socket->ssl_bio, NULL));
        }
############################################################
#####################################


Right now, I am receiving 0 (zero) as the reason in both the cases, and
none of SSL_ERROR_WANT_WRITE or SSL_ERROR_WANT_READ (in either case).


Thanks and Regards,
Ajay



-- 
Regards,
Ajay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20161010/15f8295f/attachment.html>


More information about the openssl-users mailing list