Re: Blocking on a non-blocking socket?

Neil Horman <[email protected]>
Newsgroups gmane.comp.encryption.openssl.user
Message-ID <CAJbOq17-5bint1TqMJ1519reTMyZw0QSObx4XG6rrTEDvikNuw@mail.gmail.com>
from:
https://www.openssl.org/docs/man1.0.2/man3/SSL_CTX_set_mode.html

SSL_MODE_AUTO_RETRY in non-blocking mode should cause SSL_reaa/SSL_write to
return -1 with an error code of WANT_READ/WANT_WRITE until such time as the
re-negotiation has completed.  I need to confirm thats the case in the
code, but it seems to be.  If the underlying socket is in non-blocking
mode, there should be no way for calls to block in SSL_read/SSL_write on
the socket read/write system call.

On Thu, May 23, 2024 at 8:15 AM Wiebe Cazemier <[email protected]> wrote:

> ----- Original Message -----
> > From: "Neil Horman" <[email protected]>
> > To: "udhayakumar" <udhayakumar-lPYBU9dLbzqBUy7/[email protected]>
> > Cc: "Wiebe Cazemier" <[email protected]>, [email protected]
> > Sent: Thursday, 23 May, 2024 22:05:22
> > Subject: Re: Blocking on a non-blocking socket?
>
> > do you have a stack trace of the thread hung in this state? That would
> confirm
> > whats going on here
> > Neil
>
> Hi Neil,
>
> No, I don't. I wasn't there to attach a debugger. It recovered before I
> could do that. And despite a lot of effort, I can't reproduce it either.
>
> But in general, what does SSL_MODE_AUTO_RETRY on/off change in
> non-blocking mode? The documentation is too vague for me. It says:
>
> > Setting SSL_MODE_AUTO_RETRY for a nonblocking BIO will process
> non-application data records until either no more data is available or an
> application data record has been processed.
>
> But how is that different from disabling SSL_MODE_AUTO_RETRY?
>
> Regards,
>
> Wiebe
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.