SSL_GET_EVENT_TIMEOUT(3SSL)
π SSL_GET_EVENT_TIMEOUT π
okay so bestie, we're in SSL_GET_EVENT_TIMEOUT(3SSL) territory and it's giving β¨time managementβ¨ for your SSL objects. like, when does this thing need attention next? that's the whole vibe.
πΈ NAME πΈ
SSL_get_event_timeout β figures out when an SSL object next needs to have events handled π
π¦ SYNOPSIS π¦
#include <openssl/ssl.h>
int SSL_get_event_timeout(SSL *s, struct timeval *tv, int *is_infinite);
β¨ DESCRIPTION β¨
SSL_get_event_timeout() is literally the function that tells you when the SSL object next needs to perform internal processing due to the passage of time. like, time keeps passing, bestie, and somebody's gotta notice. π°οΈ
All arguments are required, no cap. tv and is_infinite must be non-NULL. don't try to be cute and pass nothing, it will not slay.
When SSL_get_event_timeout() returns successfully, one of these three situations is what you're in:
- π¨ The SSL object has events that need to be handled right now, immediately, this second. The fields of
*tvare set to0and*is_infiniteis set to0. - β³ The SSL object has events that need to be handled after some amount of time (relative to the time at which
SSL_get_event_timeout()was called).*tvgets set to the amount of time after whichSSL_handle_events(3)should be called, and*is_infiniteis set to0. - π There are currently no timer events which require handling in the future. The value of
*tvis unspecified and*is_infiniteis set to1.
ngl, this function is currently applicable only to DTLS and QUIC connection SSL objects. if you call it on any other kind of SSL object, it always outputs infinity. and the way thatβ¦ that's considered a success condition π«Ά. not a bug, not a fail, just infinity, iconic.
For DTLS, you can use this instead of the older DTLSv1_get_timeout(3) function. the key difference, and this is the part i need you to remember: this function differs from DTLSv1_get_timeout(3) in that the case where no timeout is active is considered a success condition. yes queen, no timeout is a good thing here.
Also lowkey important: the value output by a call to SSL_get_event_timeout() may change as a result of other calls to the SSL object. so don't stash it somewhere forever like it's gospel, bestie, it's a snapshot πΈ.
Once the timeout expires, SSL_handle_events(3) should be called to handle any internal processing which is due. for more info, go read SSL_handle_events(3). like actually read it.
And, note: SSL_get_event_timeout() supersedes the older DTLSv1_get_timeout(3) function for all use cases. periodt. old one is retired, new one eats π
β οΈ If the call toSSL_get_event_timeout()fails, the values of*tvand*is_infinitemay still be changed and their values become unspecified. so basically, don't trust them after a fail. it's giving chaos, and not the cute kind π
π₯ RETURN VALUES π₯
- Returns
1on success β - Returns
0on failure π
π SEE ALSO π
π HISTORY π
The SSL_get_event_timeout() function was added in OpenSSL 3.2. so if you're on something older, it's not there, sorry babe π
π COPYRIGHT π
Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
and that's the whole page, bestie π«Ά this was version 4.0.3, dated 2026-09-29, and it's the SSL_GET_EVENT_TIMEOUT(3SSL) manual β go handle your events, mwah πβ¨π
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms