SSL_CTX_FLUSH_SESSIONS(3SSL)
π SSL_CTX_FLUSH_SESSIONS π
okay bestie, welcome to the SSL_CTX_FLUSH_SESSIONS manual page, section 3SSL β yes it's an OpenSSL joint, yes it's about yeeting expired sessions out of your cache, and yes we're gonna make it cute. π
β¨ NAME β¨
SSL_CTX_flush_sessions_ex, SSL_CTX_flush_sessions β remove expired sessions π§Ήβ¨
πΈ SYNOPSIS πΈ
#include <openssl/ssl.h>
void SSL_CTX_flush_sessions_ex(SSL_CTX *ctx, time_t tm);
so about the other one, bestieβ¦ the following functions have been deprecated since OpenSSL 3.4, and you can hide them completely by defining OPENSSL_API_COMPAT with a suitable version value β check openssl_user_macros(7) for the tea β:
void SSL_CTX_flush_sessions(SSL_CTX *ctx, long tm);
π¦ DESCRIPTION π¦
SSL_CTX_flush_sessions_ex() does a lil run-through of the session cache of ctx and removes the sessions that were expired at time tm. literally just spring cleaning your session stash. π
SSL_CTX_flush_sessions() is the older variant of the function β and no shade but it is not Y2038 safe π because it uses the long datatype instead of time_t. rip.
π NOTES π
if it's enabled, the internal session cache will collect all sessions established up to the specified maximum number β see SSL_CTX_sess_set_cache_size(). and here's the thing: sessions do not get reused once they're expired, so they should be removed from the cache to save resources. no point keeping expired things around, that's giving hoarder energy. π
you can do this two ways:
- automatically, whenever 255 new sessions were established (see
SSL_CTX_set_session_cache_mode(3)), or - manually, by calling
SSL_CTX_flush_sessions_ex().
the parameter tm specifies the time that should be used for the expiration test β in most cases the actual time given by time(0) will be used. β
SSL_CTX_flush_sessions_ex() will only check sessions stored in the internal cache. when a session is found and removed, the remove_session_cb is however called to synchronize with the external cache β see SSL_CTX_sess_set_get_cb(3). so the external cache still gets the memo, no cap. π«Ά
π RETURN VALUES π
SSL_CTX_flush_sessions_ex() does not return a value. nothing. void. it simply does the thing and leaves. main character energy honestly. π
π SEE ALSO π
π HISTORY π
SSL_CTX_flush_sessions_ex() was added in OpenSSL 3.4. she's new here but she's iconic already. β¨
π COPYRIGHT π
Copyright 2001-2024 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>.
fr fr, that's the whole page. go forth and flush responsibly. π§π
and that's a wrap babes β this was 4.0.3, dated 2026-09-29, serving you the SSL_CTX_FLUSH_SESSIONS(3SSL) realness. slay, hydrate, and may your caches always be clean. πβ¨πΈ
π¦ 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