5 SSL_get_ciphers, SSL_get_cipher_list - get list of available SSL_CIPHERs
9 #include <openssl/ssl.h>
11 STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *ssl);
12 STACK_OF(SSL_CIPHER) *SSL_get1_supported_ciphers(SSL *s);
13 STACK_OF(SSL_CIPHER) *SSL_get_client_ciphers(const SSL *ssl);
14 const char *SSL_get_cipher_list(const SSL *ssl, int priority);
18 SSL_get_ciphers() returns the stack of available SSL_CIPHERs for B<ssl>,
19 sorted by preference. If B<ssl> is NULL or no ciphers are available, NULL
22 SSL_get1_supported_ciphers() returns the stack of enabled SSL_CIPHERs for
23 B<ssl>, sorted by preference.
24 The list depends on settings like the cipher list, the supported protocol
25 versions, the security level, and the enabled signature algorithms.
26 SRP and PSK ciphers are only enabled if the appropriate callbacks or settings
28 This is the list that will be sent by the client to the server.
29 The list supported by the server might include more ciphers in case there is a
30 hole in the list of supported protocols.
31 The server will also not use ciphers from this list depending on the
32 configured certificates and DH parameters.
33 If B<ssl> is NULL or no ciphers are available, NULL is returned.
35 SSL_get_client_ciphers() returns the stack of available SSL_CIPHERs matching the
36 list received from the client on B<ssl>. If B<ssl> is NULL, no ciphers are
37 available, or B<ssl> is not operating in server mode, NULL is returned.
39 SSL_get_cipher_list() returns a pointer to the name of the SSL_CIPHER
40 listed for B<ssl> with B<priority>. If B<ssl> is NULL, no ciphers are
41 available, or there are less ciphers than B<priority> available, NULL
46 The details of the ciphers obtained by SSL_get_ciphers(),
47 SSL_get1_supported_ciphers() and SSL_get_client_ciphers() can be obtained using
48 the L<SSL_CIPHER_get_name(3)> family of functions.
50 Call SSL_get_cipher_list() with B<priority> starting from 0 to obtain the
51 sorted list of available ciphers, until NULL is returned.
53 Note: SSL_get_ciphers() and SSL_get_client_ciphers() return a pointer
54 to an internal cipher stack, which will be freed later on when the SSL
55 or SSL_SESSION object is freed. Therefore, the calling code B<MUST
56 NOT> free the return value itself.
58 The stack returned by SSL_get1_supported_ciphers() should be freed using
67 L<ssl(3)>, L<SSL_CTX_set_cipher_list(3)>,
68 L<SSL_CIPHER_get_name(3)>