1e71b7053SJung-uk Kim=pod 2e71b7053SJung-uk Kim 3e71b7053SJung-uk Kim=head1 NAME 4e71b7053SJung-uk Kim 5e71b7053SJung-uk KimSSL_SESSION_get_id, 6e71b7053SJung-uk KimSSL_SESSION_set1_id 7e71b7053SJung-uk Kim- get and set the SSL session ID 8e71b7053SJung-uk Kim 9e71b7053SJung-uk Kim=head1 SYNOPSIS 10e71b7053SJung-uk Kim 11e71b7053SJung-uk Kim #include <openssl/ssl.h> 12e71b7053SJung-uk Kim 13e71b7053SJung-uk Kim const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s, 14*b077aed3SPierre Pronchery unsigned int *len); 15e71b7053SJung-uk Kim int SSL_SESSION_set1_id(SSL_SESSION *s, const unsigned char *sid, 16e71b7053SJung-uk Kim unsigned int sid_len); 17e71b7053SJung-uk Kim 18e71b7053SJung-uk Kim=head1 DESCRIPTION 19e71b7053SJung-uk Kim 20e71b7053SJung-uk KimSSL_SESSION_get_id() returns a pointer to the internal session id value for the 21e71b7053SJung-uk Kimsession B<s>. The length of the id in bytes is stored in B<*len>. The length may 22e71b7053SJung-uk Kimbe 0. The caller should not free the returned pointer directly. 23e71b7053SJung-uk Kim 24e71b7053SJung-uk KimSSL_SESSION_set1_id() sets the session ID for the B<ssl> SSL/TLS session 25e71b7053SJung-uk Kimto B<sid> of length B<sid_len>. 26e71b7053SJung-uk Kim 27e71b7053SJung-uk Kim=head1 RETURN VALUES 28e71b7053SJung-uk Kim 29e71b7053SJung-uk KimSSL_SESSION_get_id() returns a pointer to the session id value. 30e71b7053SJung-uk KimSSL_SESSION_set1_id() returns 1 for success and 0 for failure, for example 31e71b7053SJung-uk Kimif the supplied session ID length exceeds B<SSL_MAX_SSL_SESSION_ID_LENGTH>. 32e71b7053SJung-uk Kim 33e71b7053SJung-uk Kim=head1 SEE ALSO 34e71b7053SJung-uk Kim 35e71b7053SJung-uk KimL<ssl(7)> 36e71b7053SJung-uk Kim 37e71b7053SJung-uk Kim=head1 HISTORY 38e71b7053SJung-uk Kim 396935a639SJung-uk KimThe SSL_SESSION_set1_id() function was added in OpenSSL 1.1.0. 40e71b7053SJung-uk Kim 41e71b7053SJung-uk Kim=head1 COPYRIGHT 42e71b7053SJung-uk Kim 43*b077aed3SPierre ProncheryCopyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved. 44e71b7053SJung-uk Kim 45*b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License"). You may not use 46e71b7053SJung-uk Kimthis file except in compliance with the License. You can obtain a copy 47e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at 48e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>. 49e71b7053SJung-uk Kim 50e71b7053SJung-uk Kim=cut 51