SSL_GET_EVENT_TIMEOUT(3ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

🌸 SSL_get_event_timeout β€” the "when do I need to check in on my SSL baby" girlie πŸ’…

okay so this is from the 3ossl manual fam, and it's literally the function that tells you when your SSL object is gonna need a little attention next. bestie, it's giving "calendar reminder for your TLS situationship" πŸ—“οΈβœ¨


✨ NAME ✨

SSL_get_event_timeout β€” determine 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() figures out when your SSL object next needs to do some internal processing just because time passed. like, no data arrived, nobody said anything, it's just been sitting there and the clock is ticking, yk? ⏰

All arguments are required β€” no skipping, no "oops I forgot", tv and is_infinite must be non-NULL. periodt. 🚫

When SSL_get_event_timeout() returns successfully, one of these three iconic scenarios applies:

  • Immediate girlie 🚨 β€” the SSL object has events that need handling right now. The fields of *tv are set to 0 and *is_infinite is set to 0.
  • Soonβ„’ ⏳ β€” the object has events that need handling after some amount of time (relative to the time you called SSL_get_event_timeout(), iykyk). *tv is set to the amount of time after which SSL_handle_events(3) should be called, and *is_infinite is set to 0.
  • Nothing on the schedule πŸ’€ β€” there are currently no timer events that need handling in the future. The value of *tv is unspecified and *is_infinite is set to 1.

Real talk: 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 actually considered a success condition, not a fail. slay. πŸ‘‘

For DTLS, you can use this instead of the older DTLSv1_get_timeout(3). The glow-up here? This function differs from DTLSv1_get_timeout(3) in that the case where no timeout is active is considered a success condition. no cap, that's the upgrade. 🌈

⚠️ heads up bestie: 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 go clutching that value like it's forever.

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). it's all connected, fr fr. πŸ”—

Also, SSL_get_event_timeout() supersedes the older DTLSv1_get_timeout(3) function for all use cases. out with the old, in with the new. πŸ’…

😭 if the call to SSL_get_event_timeout() fails, the values of *tv and *is_infinite may still be changed, and their values become unspecified. so like... don't trust them after a fail, okay?

πŸŽ€ RETURN VALUES πŸŽ€

  • 1 β€” success, we ate πŸ’–
  • 0 β€” failure, RIP πŸ™ˆ

🧚 SEE ALSO 🧚


πŸ‘‘ HISTORY πŸ‘‘

The SSL_get_event_timeout() function was added in OpenSSL 3.2. a modern icon, honestly. 🌟


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, no notes πŸ“ this was 3.5.0, dated 2026-09-25, from the SSL_GET_EVENT_TIMEOUT(3ossl) fam β€” mwah, go handle ur events bestie πŸ’‹πŸ’…βœ¨

πŸ“¦ where this page comes from