How does SSL_get_error() handle timeouts?

43 views
Skip to first unread message

Hal Murray

unread,
Jul 9, 2025, 5:22:06 PM7/9/25
to openss...@openssl.org, Hal Murray

I'm interested in the case where the underlying socket has done
setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, ...
(and/or SO_SNDTIMEO)

The man page doesn't mention timeout.


--
These are my opinions. I hate spam.



Viktor Dukhovni

unread,
Jul 10, 2025, 4:24:54 AM7/10/25
to openss...@openssl.org
On Wed, Jul 09, 2025 at 02:21:57PM -0700, Hal Murray wrote:

> I'm interested in the case where the underlying socket has done
> setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, ...
> (and/or SO_SNDTIMEO)

I wouldn't expect anything special to happen happen here, if a read
times out, that's just a read error, so shouldn't look different from a
TCP reset, or similar transport/network layer problem.

FWIW, Postfix handles this differently, the socket is set non-blocking
and retries of the SSL handshake or read/write operations, after
WANTREAD or WANTWRITE, happen only after the socket polls ready, and if
those polls time out the (SMTP) application processes a timeout above
the TLS layer, abandoning the SSL connection.

--
Viktor. 🇺🇦 Слава Україні!
Reply all
Reply to author
Forward
0 new messages