SSL_GET_EVENT_TIMEOUT(3ossl)
π SSL_GET_EVENT_TIMEOUT(3ossl) β the OpenSSL girlies' guide
okay so bestie, you're in the 3ossl section, this is an OpenSSL page, and we're talking about SSL_get_event_timeout. it's giving "when do I need to come back and deal with you" energy β¨
πΈ NAME
SSL_get_event_timeout β figure out when an SSL object next needs to have its events handled π
π SYNOPSIS
#include <openssl/ssl.h>
int SSL_get_event_timeout(SSL *s, struct timeval *tv, int *is_infinite);
π¦ DESCRIPTION
so SSL_get_event_timeout() figures out when your SSL object next needs to do its internal processing, just because time keeps passing like it always does. no cap. β°
every single argument is required, okay?? tv and is_infinite must be non-NULL. not optional, not "I'll fill it in later". required. periodt.
when SSL_get_event_timeout() returns successfully, exactly one of these three situations is happening:
- the SSL object has events that need to be handled right now, immediately. the fields of
*tvare set to0and*is_infiniteis set to0. go go go πβοΈ - the SSL object has events that need to be handled after some amount of time (measured relative to the time at which
SSL_get_event_timeout()was called, fyi).*tvis set to the amount of time after whichSSL_handle_events(3)should be called, and*is_infiniteis set to0. so like, set a little timer bestie β³ - there are currently no timer events that need handling in the future. in that case the value of
*tvis unspecified (don't look at it, it's not for you π) and*is_infiniteis set to1. eternal peace. iconic.
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 that's considered a success condition, so don't stress π
for DTLS, you can use this function instead of the older DTLSv1_get_timeout(3) function. but heads up: this function differs from DTLSv1_get_timeout(3) in that the case where no timeout is active is considered a success condition. lowkey a glow-up.
also note that the value output by a call to SSL_get_event_timeout() may change as a result of other calls to the SSL object. it's a living document fr fr.
once the timeout expires, SSL_handle_events(3) should be called to handle any internal processing which is due; for more information, see SSL_handle_events(3). π read that one too.
and also: SSL_get_event_timeout() supersedes the older DTLSv1_get_timeout(3) function for all use cases. all of them. it ate and left no crumbs. π₯
β οΈ if the call toSSL_get_event_timeout()fails, the values of*tvand*is_infinitemay still be changed, and their values become unspecified. so don't trust them after a failure, bestie. that's just how it is π
β RETURN VALUES
returns 1 on success and 0 on failure. simple as that, no plot twist π«Ά
π SEE ALSO
β¨ HISTORY
the SSL_get_event_timeout() function was added in OpenSSL 3.2. a relatively recent queen π
π 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>.
okay that's the whole page, you're so welcome π this was version 3.5.9, dated 2026-09-29, and yes the manual name is SSL_GET_EVENT_TIMEOUT(3ossl) in case you forgot already. mwah, go handle your events πβ¨
π¦ where this page comes from
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms