SSL_SESSION_FREE - Online Linux Manual PageSection : 3
Updated : 2021-03-26
Source : 1.1.1k
Note : OpenSSL

NAMESSL_SESSION_new, SSL_SESSION_dup, SSL_SESSION_up_ref, SSL_SESSION_free − create, free and manage SSL_SESSION structures

SYNOPSIS​ #include <openssl/ssl.h> ​ ​ SSL_SESSION *SSL_SESSION_new(void); ​ SSL_SESSION *SSL_SESSION_dup(SSL_SESSION *src); ​ int SSL_SESSION_up_ref(SSL_SESSION *ses); ​ void SSL_SESSION_free(SSL_SESSION *session);

DESCRIPTIONSSL_SESSION_new() creates a new SSL_SESSION structure and returns a pointer to it. SSL_SESSION_dup() copies the contents of the SSL_SESSION structure in src and returns a pointer to it. SSL_SESSION_up_ref() increments the reference count on the given SSL_SESSION structure. SSL_SESSION_free() decrements the reference count of session and removes the SSL_SESSION structure pointed to by session and frees up the allocated memory, if the reference count has reached 0. If session is NULL nothing is done.

NOTESSSL_SESSION objects are allocated, when a TLS/SSL handshake operation is successfully completed. Depending on the settings, see ​SSL_CTX_set_session_cache_mode(3), the SSL_SESSION objects are internally referenced by the SSL_CTX and linked into its session cache. SSL objects may be using the SSL_SESSION object; as a session may be reused, several SSL objects may be using one SSL_SESSION object at the same time. It is therefore crucial to keep the reference count (usage information) correct and not delete a SSL_SESSION object that is still used, as this may lead to program failures due to dangling pointers. These failures may also appear delayed, e.g. when an SSL_SESSION object was completely freed as the reference count incorrectly became 0, but it is still referenced in the internal session cache and the cache list is processed during a ​SSL_CTX_flush_sessions(3) operation. SSL_SESSION_free() must only be called for SSL_SESSION objects, for which the reference count was explicitly incremented (e.g. by calling SSL_get1_session(), see SSL_get_session(3)) or when the SSL_SESSION object was generated outside a TLS handshake operation, e.g. by using d2i_SSL_SESSION(3). It must not be called on other SSL_SESSION objects, as this would cause incorrect reference counts and therefore program failures.

RETURN VALUESSSL_SESSION_new returns a pointer to the newly allocated SSL_SESSION structure or NULL on error. SSL_SESSION_up_ref returns 1 on success or 0 on error.

SEE ALSOssl(7), SSL_get_session(3), ​SSL_CTX_set_session_cache_mode(3), ​SSL_CTX_flush_sessions(3), ​d2i_SSL_SESSION(3)

HISTORYThe SSL_SESSION_dup() function was added in OpenSSL 1.1.1.

COPYRIGHTCopyright 2000−2016 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (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>.
0
Johanes Gumabo
Data Size   :   10,253 byte
man-SSL_SESSION_dup.3sslBuild   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   3 / 173,629
Visitor ID   :     :  
Visitor IP   :   3.12.163.120   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (parse_manual_page_|249|S___SL_SESSION_dup.3ssl|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\| )         (htmlprn|149|S___SL_SESSION_dup.3ssl|36/37|.el══─{─══. ds --  —  |.el══─{─══. ds -- \|\(em\| )         (parse_manual_page_|249|S___SL_SESSION_dup.3ssl|43|br══─}─══|'br══─}─══ )         (htmlprn|149|S___SL_SESSION_dup.3ssl|43|'br══─}─══ |'br══─}─══ )