Skip to content

mysql_ssl_set

Georg Richter edited this page Aug 17, 2018 · 5 revisions

Name

mysql_ssl_set - Sets TLS/SSL options

Synopsis

#include <mysql.h>

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

Description

Used for establishing a [secure-connections()](secure TLS connection]]. It must be called before attempting to use mysql_real_connect(). 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.

Parameter

  • mysql - a mysql handle, which was previously allocated by mysql_init().
  • 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.

Notes

See also

Clone this wiki locally