1SSL_GET_CURRENT_CIPHER(3ossl)       OpenSSL      SSL_GET_CURRENT_CIPHER(3ossl)
2
3
4

NAME

6       SSL_get_current_cipher, SSL_get_cipher_name, SSL_get_cipher,
7       SSL_get_cipher_bits, SSL_get_cipher_version, SSL_get_pending_cipher -
8       get SSL_CIPHER of a connection
9

SYNOPSIS

11        #include <openssl/ssl.h>
12
13        const SSL_CIPHER *SSL_get_current_cipher(const SSL *ssl);
14        const SSL_CIPHER *SSL_get_pending_cipher(const SSL *ssl);
15
16        const char *SSL_get_cipher_name(const SSL *s);
17        const char *SSL_get_cipher(const SSL *s);
18        int SSL_get_cipher_bits(const SSL *s, int *np);
19        const char *SSL_get_cipher_version(const SSL *s);
20

DESCRIPTION

22       SSL_get_current_cipher() returns a pointer to an SSL_CIPHER object
23       containing the description of the actually used cipher of a connection
24       established with the ssl object.  See SSL_CIPHER_get_name(3) for more
25       details.
26
27       SSL_get_cipher_name() obtains the name of the currently used cipher.
28       SSL_get_cipher() is identical to SSL_get_cipher_name().
29       SSL_get_cipher_bits() is a macro to obtain the number of
30       secret/algorithm bits used and SSL_get_cipher_version() returns the
31       protocol name.
32
33       SSL_get_pending_cipher() returns a pointer to an SSL_CIPHER object
34       containing the description of the cipher (if any) that has been
35       negotiated for future use on the connection established with the ssl
36       object, but is not yet in use.  This may be the case during handshake
37       processing, when control flow can be returned to the application via
38       any of several callback methods.  The internal sequencing of handshake
39       processing and callback invocation is not guaranteed to be stable from
40       release to release, and at present only the callback set by
41       SSL_CTX_set_alpn_select_cb() is guaranteed to have a non-NULL return
42       value.  Other callbacks may be added to this list over time.
43

RETURN VALUES

45       SSL_get_current_cipher() returns the cipher actually used, or NULL if
46       no session has been established.
47
48       SSL_get_pending_cipher() returns the cipher to be used at the next
49       change of cipher suite, or NULL if no such cipher is known.
50

NOTES

52       SSL_get_cipher, SSL_get_cipher_bits, SSL_get_cipher_version, and
53       SSL_get_cipher_name are implemented as macros.
54

SEE ALSO

56       ssl(7), SSL_CIPHER_get_name(3)
57
59       Copyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved.
60
61       Licensed under the Apache License 2.0 (the "License").  You may not use
62       this file except in compliance with the License.  You can obtain a copy
63       in the file LICENSE in the source distribution or at
64       <https://www.openssl.org/source/license.html>.
65
66
67
683.0.5                             2022-07-05     SSL_GET_CURRENT_CIPHER(3ossl)
Impressum