mysql\_get\_ssl\_cipher(3) MariaDB Connector/C mysql\_get\_ssl\_cipher(3)

## [Name](#Name)

mysql\_get\_ssl\_cipher - returns the cipher suite in use

## [Synopsis](#Synopsis)

```
#include <mysql.h>
const char *mysql_get_ssl_cipher(MYSQL *mysql) 
    
```

## [Description](#Description)

Returns the name of the currently used cipher suite of the secure connection, or NULL for non TLS connections.

## [Parameter](#Parameter)

•

mysql - a connection identifier, which was previously allocated by [**mysql\_init(3)**](/man/os/mariadb-10.6/mysql_init.3) and connected by [**mysql\_real\_connect(3)**](/man/os/mariadb-10.6/mysql_real_connect.3).

## [Notes](#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-SHA for OpenSSL and Schannel and TLS\_RSA\_AES\_128\_CBC\_SHA1 for GnuTLS.

## [Return value](#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.

## [See also](#See_also)

•

[**mysql\_ssl\_set(3)**](/man/os/mariadb-10.6/mysql_ssl_set.3)

Version 3.3.1

---

Document: mysql_get_ssl_cipher(3) from mariadb-10.6 10.6.12-r1 (Chainguard OS)
Source: https://github.com/MariaDB/server.git
