mysql_get_ssl_cipher(3)
π mysql_get_ssl_cipher(3) π
okay bestie, so this one lives in the MariaDB Connector/C manual, and it's genuinely one of the cutest little functions ever β it just tells you what cipher suite your secure connection is vibing with rn. no cap. π
β¨ Name β¨
mysql_get_ssl_cipher β returns the cipher suite in use π
πΈ Synopsis πΈ
#include <mysql.h>
const char *mysql_get_ssl_cipher(MYSQL *mysql)
π¦ Description π¦
It returns the name of the currently used cipher suite of the secure connection, or NULL for non TLS connections. that's it. that's the whole function. iconic behaviour honestly π
π Parameter π
mysqlβ a connection identifier, which was previously allocated bymysql_init(3)and connected bymysql_real_connect(3). like, you can't just hand it a random pointer bestie, it needs to be a real live connection that actually went through the whole init-then-connect pipeline first π«Ά
π Notes π
- For using
mysql_get_ssl_cipher()MariaDB Connector/C must be built with TLS/SSL support, otherwise the function will returnNULL. so if your build skipped the TLS glow-up, this function is just gonna shrug at you π mysql_get_ssl_cipher()can be used to determine if the client server connection is secure. vibe check your connection, basically β¨- 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. same cipher, three different names, it's giving "same girl different username on every app" π so don't be shocked when the string doesn't match what you expected β check which library you're running first.
π 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. so: string = slay, NULL = no encryption happening here, periodt π
π See also π
heads up bestie: if you getNULLback it doesn't automatically mean something broke β it can just mean the connection isn't using TLS/SSL at all, or that the library was built without TLS/SSL support. two very different reasons, same sad littleNULLπ₯²
Version 3.4 β mysql_get_ssl_cipher(3), mwah, that's a wrap, tysm for reading my little manpage essay, go check your cipher suites and stay encrypted out there πβ¨ππ¦π
π¦ where this page comes from
- alpine 3.22: mariadb-doc 11.4.13-r0 Β· GPL-2.0-or-later
- alpine 3.23: mariadb-doc 11.4.13-r0 Β· GPL-2.0-or-later
- alpine 3.24: mariadb-doc 11.8.9-r0 Β· GPL-2.0-only
- arch rolling: mariadb 13.0.2-2 Β· GPL-2.0-only
- arch rolling: mariadb-lts 12.3.3-2 Β· GPL-2.0-only
- centos-stream 10: mariadb-connector-c-doc 3.4.4-2.el10 Β· LGPL-2.1-or-later
- debian trixie: libmariadb-dev 1:11.8.6-0+deb13u1 Β· GPL-2.0-only
- fedora 43: mariadb-connector-c-doc 3.4.5-2.fc43 Β· LGPL-2.1-or-later AND PHP-3.0 AND PHP-3.01
- fedora 43: mariadb-connector-c-doc 3.4.9-2.fc43 Β· LGPL-2.1-or-later AND PHP-3.0 AND PHP-3.01 AND LicenseRef-Fedora-Public-Domain
- fedora 44: mariadb-connector-c-doc 3.4.8-3.fc44 Β· LGPL-2.1-or-later AND PHP-3.0 AND PHP-3.01
- fedora 44: mariadb-connector-c-doc 3.4.9-2.fc44 Β· LGPL-2.1-or-later AND PHP-3.0 AND PHP-3.01 AND LicenseRef-Fedora-Public-Domain
- nixpkgs unstable: mariadb-server 11.8.8
- opensuse-leap 16.0: libmariadb-devel 3.4.9-160000.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libmariadb-devel 3.4.9-160000.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libmariadb-devel 3.4.9-160000.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libmariadb-devel 3.4.9-160000.1.1 Β· LGPL-2.1-or-later
- ubuntu questing: libmariadb-dev 1:11.8.3-1build1
- ubuntu resolute: libmariadb-dev 1:11.8.6-5 Β· GPL-2.0-only
- ubuntu resolute: libmariadb-dev 1:11.8.6-5ubuntu0.1 Β· GPL-2.0-only
- ubuntu stonking: libmariadb-dev 1:11.8.9+ds-4ubuntu2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms