mysql_get_ssl_cipher
mysql_get_ssl_cipher returns the name of the TLS cipher in use for a MariaDB Connector/C connection, or NULL for non-TLS connections.
Syntax
const char *mysql_get_ssl_cipher(MYSQL *mysql)Parameter
mysql- a mysql handle, which was previously allocated by mysql_init() or mysql_real_connect().
Description
Returns the name of the currently used cipher of the TLS connection, or NULL for non TLS connections.
Return Value
Returns a zero terminated string containing the cipher suite used for a secure connection, or NULL if connection doesn't use TLS/SSL.
Notes
For using
mysql_get_ssl_cipher()MariaDB Connector/C must be built with TLS/SSL support, otherwise the function will return NULL.`mysql_get_ssl_cipher()' can be used to determine if the client server connection is secure.
Depending on the TLS library in use (OpenSSL, GnuTLS or Windows Schannel) the name of the cipher suites may differ. For example the cipher suite 0x002F (
TLS_RSA_WITH_AES_128_CBC_SHA) has different names:AES128-SHAfor OpenSSL and Schannel andTLS_RSA_AES_128_CBC_SHA1for GnuTLS.
See Also
This page is: Copyright © 2026 MariaDB. All rights reserved.
Last updated
Was this helpful?

