1e71b7053SJung-uk Kim=pod 2e71b7053SJung-uk Kim 3e71b7053SJung-uk Kim=head1 NAME 4e71b7053SJung-uk Kim 5e71b7053SJung-uk KimSSL_SESSION_get0_cipher, 6e71b7053SJung-uk KimSSL_SESSION_set_cipher 7e71b7053SJung-uk Kim- set and retrieve the SSL cipher associated with a session 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 SSL_CIPHER *SSL_SESSION_get0_cipher(const SSL_SESSION *s); 14e71b7053SJung-uk Kim int SSL_SESSION_set_cipher(SSL_SESSION *s, const SSL_CIPHER *cipher); 15e71b7053SJung-uk Kim 16e71b7053SJung-uk Kim=head1 DESCRIPTION 17e71b7053SJung-uk Kim 18e71b7053SJung-uk KimSSL_SESSION_get0_cipher() retrieves the cipher that was used by the 19e71b7053SJung-uk Kimconnection when the session was created, or NULL if it cannot be determined. 20e71b7053SJung-uk Kim 21e71b7053SJung-uk KimThe value returned is a pointer to an object maintained within B<s> and 22e71b7053SJung-uk Kimshould not be released. 23e71b7053SJung-uk Kim 24e71b7053SJung-uk KimSSL_SESSION_set_cipher() can be used to set the ciphersuite associated with the 25e71b7053SJung-uk KimSSL_SESSION B<s> to B<cipher>. For example, this could be used to set up a 26e71b7053SJung-uk Kimsession based PSK (see L<SSL_CTX_set_psk_use_session_callback(3)>). 27e71b7053SJung-uk Kim 28e71b7053SJung-uk Kim=head1 RETURN VALUES 29e71b7053SJung-uk Kim 30e71b7053SJung-uk KimSSL_SESSION_get0_cipher() returns the SSL_CIPHER associated with the SSL_SESSION 31e71b7053SJung-uk Kimor NULL if it cannot be determined. 32e71b7053SJung-uk Kim 33e71b7053SJung-uk KimSSL_SESSION_set_cipher() returns 1 on success or 0 on failure. 34e71b7053SJung-uk Kim 35e71b7053SJung-uk Kim=head1 SEE ALSO 36e71b7053SJung-uk Kim 37e71b7053SJung-uk KimL<ssl(7)>, 38e71b7053SJung-uk KimL<d2i_SSL_SESSION(3)>, 39e71b7053SJung-uk KimL<SSL_SESSION_get_time(3)>, 40e71b7053SJung-uk KimL<SSL_SESSION_get0_hostname(3)>, 41e71b7053SJung-uk KimL<SSL_SESSION_free(3)>, 42e71b7053SJung-uk KimL<SSL_CTX_set_psk_use_session_callback(3)> 43e71b7053SJung-uk Kim 44e71b7053SJung-uk Kim=head1 HISTORY 45e71b7053SJung-uk Kim 466935a639SJung-uk KimThe SSL_SESSION_get0_cipher() function was added in OpenSSL 1.1.0. 476935a639SJung-uk KimThe SSL_SESSION_set_cipher() function was added in OpenSSL 1.1.1. 48e71b7053SJung-uk Kim 49e71b7053SJung-uk Kim=head1 COPYRIGHT 50e71b7053SJung-uk Kim 51e71b7053SJung-uk KimCopyright 2016-2017 The OpenSSL Project Authors. All Rights Reserved. 52e71b7053SJung-uk Kim 53*b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License"). You may not use 54e71b7053SJung-uk Kimthis file except in compliance with the License. You can obtain a copy 55e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at 56e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>. 57e71b7053SJung-uk Kim 58e71b7053SJung-uk Kim=cut 59