SSL_SESSION_GET_TIME(3)
π SSL_SESSION_GET_TIME(3) β session time & timeout vibes
okay so this one lives in the Library Functions Manual section and bestie it is so useful. It's SSL_SESSION_get_time, SSL_SESSION_set_time, SSL_SESSION_get_timeout, SSL_SESSION_set_timeout, SSL_get_time, SSL_set_time, SSL_get_timeout, and SSL_set_timeout β and yes, that's a whole squad. Their collective job? retrieve and manipulate session time and timeout settings. π°οΈβ¨
πΈ SYNOPSIS πΈ
library βlibsslβ libcrypto #include <openssl/ssl.h>
long
SSL_SESSION_get_time(const SSL_SESSION *s);
long
SSL_SESSION_set_time(SSL_SESSION *s, long tm);
long
SSL_SESSION_get_timeout(const SSL_SESSION *s);
long
SSL_SESSION_set_timeout(SSL_SESSION *s, long tm);
long
SSL_get_time(const SSL_SESSION *s);
long
SSL_set_time(SSL_SESSION *s, long tm);
long
SSL_get_timeout(const SSL_SESSION *s);
long
SSL_set_timeout(SSL_SESSION *s, long tm);
π DESCRIPTION π
So SSL_SESSION_get_time() returns the time at which the session s was established. It's given in seconds since the Epoch, which means it's compatible with whatever time(3) hands you β same units, same energy, no conversion drama. π«Ά
SSL_SESSION_set_time() replaces the creation time of the session s with the chosen value tm. Your session, your rules, your timestamp. π
SSL_SESSION_get_timeout() returns the timeout value set for session s, in seconds.
SSL_SESSION_set_timeout() sets the timeout value for session s in seconds to tm.
Now the glow-up: SSL_get_time(), SSL_set_time(), SSL_get_timeout(), and SSL_set_timeout() are synonyms for the SSL_SESSION_*() counterparts. Same functions, shorter names, we love an alias era. β¨
Sessions get expired by examining the creation time and the timeout value β both, together, the whole duo. Both are set at creation time of the session: the actual time, and the default timeout value at creation respectively, as set by SSL_CTX_set_timeout(3). And with these functions you can extend or shorten the lifetime of the session. Lengthen it, trim it, you're the main character here. π
π RETURN VALUES π
SSL_SESSION_get_time()andSSL_SESSION_get_timeout()return the currently valid values.SSL_SESSION_set_time()andSSL_SESSION_set_timeout()return1on success.
β οΈ If any of the functions is passed theNULLpointer for the sessions,0is returned. no cap, protect your pointers bestie π
π¦ SEE ALSO π¦
ssl(3)SSL_CTX_set_timeout(3)SSL_get_default_timeout(3)SSL_get_session(3)SSL_SESSION_has_ticket(3)SSL_SESSION_new(3)
β HISTORY β
SSL_get_time(), SSL_get_timeout(), and SSL_set_timeout() appeared in SSLeay 0.4 or earlier β literal ancients, iconic behavior. SSL_set_time() first appeared in SSLeay 0.5.2. Then SSL_SESSION_get_time(), SSL_SESSION_set_time(), SSL_SESSION_get_timeout(), and SSL_SESSION_set_timeout()` first appeared in **SSLeay 0.9.0. And all these functions have been available since OpenBSD 2.4. a whole legacy β¨π
okay that's the page!! this one came from the Debian build, dated June 8, 2025 β mwah, bye bestie, go set some timeouts ππ
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2001, 2005, 2006, 2016 The OpenSSL Project
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms