5 SSL_SESSION_get0_cipher,
7 - set and retrieve the SSL cipher associated with a session
11 #include <openssl/ssl.h>
13 const SSL_CIPHER *SSL_SESSION_get0_cipher(const SSL_SESSION *s);
14 int SSL_SESSION_set_cipher(SSL_SESSION *s, const SSL_CIPHER *cipher);
18 SSL_SESSION_get0_cipher() retrieves the cipher that was used by the
19 connection when the session was created, or NULL if it cannot be determined.
21 The value returned is a pointer to an object maintained within B<s> and
22 should not be released.
24 SSL_SESSION_set_cipher() can be used to set the ciphersuite associated with the
25 SSL_SESSION B<s> to B<cipher>. For example, this could be used to set up a
26 session based PSK (see L<SSL_CTX_set_psk_use_session_callback(3)>).
30 SSL_SESSION_get0_cipher() returns the SSL_CIPHER associated with the SSL_SESSION
31 or NULL if it cannot be determined.
33 SSL_SESSION_set_cipher() returns 1 on success or 0 on failure.
38 L<d2i_SSL_SESSION(3)>,
39 L<SSL_SESSION_get_time(3)>,
40 L<SSL_SESSION_get0_hostname(3)>,
41 L<SSL_SESSION_free(3)>,
42 L<SSL_CTX_set_psk_use_session_callback(3)>
46 SSL_SESSION_get0_cipher() was first added to OpenSSL 1.1.0.
47 SSL_SESSION_set_cipher() was first added to OpenSSL 1.1.1.
51 Copyright 2016-2017 The OpenSSL Project Authors. All Rights Reserved.
53 Licensed under the OpenSSL license (the "License"). You may not use
54 this file except in compliance with the License. You can obtain a copy
55 in the file LICENSE in the source distribution or at
56 L<https://www.openssl.org/source/license.html>.