SSL_GET_SHARED_CIPHERS(3)

NAME
SSL_get_shared_ciphers - ciphers supported by both client and server

SYNOPSIS
#include <openssl/ssl.h>
char *
SSL_get_shared_ciphers(const SSL *ssl, char *buf, int len);

DESCRIPTION
SSL_get_shared_ciphers() puts the names of the ciphers that are supported by both the client and the server of ssl into the buffer buf. Names are separated by colons. At most len bytes are written to buf including the terminating NUL character.

RETURN VALUES
If ssl contains no session, if the session contains no shared ciphers, or if len is less than 2, SSL_get_shared_ciphers() returns NULL. Otherwise, it returns buf.

HISTORY
SSL_get_shared_ciphers() is available in all versions of OpenSSL.

BUGS
If the list is too long to fit into len bytes, it is silently truncated after the last cipher name that fits, and all following ciphers are skipped. If the buffer is very short such that even the first cipher name does not fit, an empty string is returned even when some shared ciphers are actually available.

There is no easy way to find out how much space is required for buf or whether the supplied space was sufficient.