1=pod 2 3=head1 NAME 4 5SSL_get_session - retrieve TLS/SSL session data 6 7=head1 SYNOPSIS 8 9 #include <openssl/ssl.h> 10 11 SSL_SESSION *SSL_get_session(SSL *ssl); 12 SSL_SESSION *SSL_get0_session(SSL *ssl); 13 SSL_SESSION *SSL_get1_session(SSL *ssl); 14 15=head1 DESCRIPTION 16 17SSL_get_session() returns a pointer to the B<SSL_SESSION> actually used in 18B<ssl>. The reference count of the B<SSL_SESSION> is not incremented, so
| 1=pod 2 3=head1 NAME 4 5SSL_get_session - retrieve TLS/SSL session data 6 7=head1 SYNOPSIS 8 9 #include <openssl/ssl.h> 10 11 SSL_SESSION *SSL_get_session(SSL *ssl); 12 SSL_SESSION *SSL_get0_session(SSL *ssl); 13 SSL_SESSION *SSL_get1_session(SSL *ssl); 14 15=head1 DESCRIPTION 16 17SSL_get_session() returns a pointer to the B<SSL_SESSION> actually used in 18B<ssl>. The reference count of the B<SSL_SESSION> is not incremented, so
|
19that the pointer can become invalid when the B<ssl> is freed and 20SSL_SESSION_free() is implicitly called.
| 19that the pointer can become invalid by other operations.
|
21 22SSL_get0_session() is the same as SSL_get_session(). 23 24SSL_get1_session() is the same as SSL_get_session(), but the reference 25count of the B<SSL_SESSION> is incremented by one. 26
| 20 21SSL_get0_session() is the same as SSL_get_session(). 22 23SSL_get1_session() is the same as SSL_get_session(), but the reference 24count of the B<SSL_SESSION> is incremented by one. 25
|
| 26=head1 NOTES 27 28The ssl session contains all information required to re-establish the 29connection without a new handshake. 30 31SSL_get0_session() returns a pointer to the actual session. As the 32reference counter is not incremented, the pointer is only valid while 33the connection is in use. If L<SSL_clear(3)|SSL_clear(3)> or 34L<SSL_free(3)|SSL_free(3)> is called, the session may be removed completely 35(if considered bad), and the pointer obtained will become invalid. Even 36if the session is valid, it can be removed at any time due to timeout 37during L<SSL_CTX_flush_sessions(3)|SSL_CTX_flush_sessions(3)>. 38 39If the data is to be kept, SSL_get1_session() will increment the reference 40count and the session will stay in memory until explicitly freed with 41L<SSL_SESSION_free(3)|SSL_SESSION_free(3)>, regardless of its state. 42
|
27=head1 RETURN VALUES 28 29The following return values can occur: 30 31=over 4 32 33=item NULL 34 35There is no session available in B<ssl>. 36 37=item Pointer to an SSL 38 39The return value points to the data of an SSL session. 40 41=back 42 43=head1 SEE ALSO 44 45L<ssl(3)|ssl(3)>, L<SSL_free(3)|SSL_free(3)>,
| 43=head1 RETURN VALUES 44 45The following return values can occur: 46 47=over 4 48 49=item NULL 50 51There is no session available in B<ssl>. 52 53=item Pointer to an SSL 54 55The return value points to the data of an SSL session. 56 57=back 58 59=head1 SEE ALSO 60 61L<ssl(3)|ssl(3)>, L<SSL_free(3)|SSL_free(3)>,
|
| 62L<SSL_clear(3)|SSL_clear(3)>,
|
46L<SSL_SESSION_free(3)|SSL_SESSION_free(3)> 47 48=cut
| 63L<SSL_SESSION_free(3)|SSL_SESSION_free(3)> 64 65=cut
|