All pages
Powered by GitBook
1 of 1

Loading...

mysql_ssl_set

mysql_ssl_set configures TLS parameters including key, certificate, CA, and cipher list for a MariaDB connection, and must be called before mysql_real_connect.

Syntax

int mysql_ssl_set(MYSQL *mysql, const char *key, const char *cert,
  const char *ca, const char *capath, const char *cipher)

Parameters

  • mysql - a mysql handle, which was previously allocated by mysql_init() or mysql_real_connect().

  • key - path to the key file.

  • cert - path to the certificate file.

  • ca - path to the certificate authority file.

  • capath - path to the directory containing the trusted TLS CA certificates in PEM format.

  • cipher list of permitted ciphers to use for TLS encryption.

Used for establishing a . It must be called before attempting to use . TLS support must be enabled in the client library in order for the function to have any effect.

NULL can be used for an unused parameter. Always returns zero.

To enable TLS without specifying certificates, set all values to NULL:

This is the same as .

mysql_ssl_set(mysql, NULL, NULL, NULL, NULL, NULL)

Description

  • will return an error if attempting to connect and TLS is incorrectly set up.

  • Even if Connector/C supports TLSv1.3 protocol, it is not possible yet to specify TLSv1.3 cipher suites via cipher parameter.

See Also

mysql_real_connect()
mysql_optionsv(mysql, MYSQL_OPT_SSL_ENFORCE, &yes)
mysql_get_ssl_cipher()
mysql_real_connect()
spinner
secure TLS connection