Document SSL_get1_supported_ciphers
[openssl.git] / doc / ssl / SSL_get_ciphers.pod
1 =pod
2
3 =head1 NAME
4
5 SSL_get_ciphers, SSL_get_cipher_list - get list of available SSL_CIPHERs
6
7 =head1 SYNOPSIS
8
9  #include <openssl/ssl.h>
10
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);
15
16 =head1 DESCRIPTION
17
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
20 is returned.
21
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
27 have been applied.
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.
34
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.
38
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
42 is returned.
43
44 =head1 NOTES
45
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.
49
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.
52
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.
57
58 The stack returned by SSL_get1_supported_ciphers() should be freed using
59 sk_SSL_CIPHER_free().
60
61 =head1 RETURN VALUES
62
63 See DESCRIPTION
64
65 =head1 SEE ALSO
66
67 L<ssl(3)>, L<SSL_CTX_set_cipher_list(3)>,
68 L<SSL_CIPHER_get_name(3)>
69
70 =cut