SSL_SESSION_NEW(3)
π SSL_SESSION_NEW(3) π
okay bestie, so this one is from the Library Functions Manual and it's literally all about making shiny new SSL_SESSION objects. it's giving "I just created a whole TLS session, no big deal" energy. you're gonna slay this, i promise π«Ά
β¨ NAME β¨
SSL_SESSION_new, SSL_SESSION_dup β construct a new SSL_SESSION object
πΈ SYNOPSIS πΈ
library βlibsslβ libcrypto
#include <openssl/ssl.h>
SSL_SESSION *
SSL_SESSION_new(void);
SSL_SESSION *
SSL_SESSION_dup(const SSL_SESSION *src);
π DESCRIPTION π
SSL_SESSION_new() allocates and initializes a new SSL_SESSION object. it's lowkey doing a whole glow-up for your session: the reference count is set to 1, the time is set to the current time, and the timeout is set to five minutes. periodt. β°
when the object is no longer needed (like, it's not the main character anymore), it can be destructed with SSL_SESSION_free(3). bye bestie π
SSL_SESSION_new() is used internally, for example by SSL_connect(3). so like, it's literally working behind the scenes 24/7. iconic behavior, tbh.
SSL_SESSION_dup() creates a deep copy of src β with a few exceptions that you NEED to know about, bestie:
- the reference count is set to
1 - the peer certificate is shared with
src - the new session is not part of any session cache
it's giving "twin but not totally identical" energy. same vibes, different reference count. πͺ
π RETURN VALUES π
SSL_SESSION_new() and SSL_SESSION_dup() return the new SSL_SESSION object β or NULL if insufficient memory is available. sad girl hours π
after failure, ERR_get_error(3) returns ERR_R_MALLOC_FAILURE. so like, at least the error message knows what's up.
π¦ SEE ALSO π¦
d2i_SSL_SESSION(3), PEM_read_SSL_SESSION(3), ssl(3), SSL_connect(3), SSL_copy_session_id(3), SSL_CTX_add_session(3), SSL_CTX_sess_set_get_cb(3), SSL_get_session(3), SSL_SESSION_free(3), SSL_SESSION_get0_peer(3), SSL_SESSION_get_compress_id(3), SSL_SESSION_get_ex_new_index(3), SSL_SESSION_get_id(3), SSL_SESSION_get_master_key(3), SSL_SESSION_get_protocol_version(3), SSL_SESSION_get_time(3), SSL_SESSION_has_ticket(3), SSL_SESSION_is_resumable(3), SSL_SESSION_print(3), SSL_SESSION_set1_id_context(3), SSL_set_session(3)
π HISTORY π
SSL_SESSION_new() first appeared in SSLeay 0.5.2 and has been available since OpenBSD 2.4. og status fr fr π
SSL_SESSION_dup() first appeared in OpenSSL 1.1.1 and has been available since OpenBSD 7.9. a newer icon has entered the chat β¨
okay that's the whole page, bestie! now go forth and construct those sessions. i'm obsessed with you for reading all this ππ
Debian β’ October 24, 2025 β’ SSL_SESSION_NEW(3) β mwah, kisses from your favorite manual page π
π¦ 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) 2016 Ingo Schwarze <schwarze@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms