5 SSL_get_session - retrieve TLS/SSL session data
9 #include <openssl/ssl.h>
11 SSL_SESSION *SSL_get_session(SSL *ssl);
12 SSL_SESSION *SSL_get0_session(SSL *ssl);
13 SSL_SESSION *SSL_get1_session(SSL *ssl);
17 SSL_get_session() returns a pointer to the B<SSL_SESSION> actually used in
18 B<ssl>. The reference count of the B<SSL_SESSION> is not incremented, so
19 that the pointer can become invalid when the B<ssl> is freed and
20 SSL_SESSION_free() is implicitly called.
22 SSL_get0_session() is the same as SSL_get_session().
24 SSL_get1_session() is the same as SSL_get_session(), but the reference
25 count of the B<SSL_SESSION> is incremented by one.
29 The following return values can occur:
35 There is no session available in B<ssl>.
37 =item Pointer to an SSL
39 The return value points to the data of an SSL session.
45 L<ssl(3)|ssl(3)>, L<SSL_free(3)|SSL_free(3)>,
46 L<SSL_SESSION_free(3)|SSL_SESSION_free(3)>