1mysql_ssl_set(3)              MariaDB Connector/C             mysql_ssl_set(3)
2
3
4
5   Name
6       mysql_ssl_set - Sets TLS/SSL options
7
8   Synopsis
9              #include <mysql.h>
10
11              my_bool mysql_ssl_set(MYSQL *mysql,
12                                    const char *key,
13                                    const char *cert,
14                                    const char *ca,
15                                    const char *capath,
16                                    const char *cipher)
17
18   Description
19       Used  for  establishing a secure TLS connection.  It must be called be‐
20       fore attempting to use mysql_real_connect(3).  TLS support must be  en‐
21       abled  in  the client library in order for the function to have any ef‐
22       fect.
23
24       NULL can be used for an unused parameter.  Always returns zero.
25
26   Parameter
27       • mysql  -  a  mysql  handle,  which  was   previously   allocated   by
28         mysql_init(3).
29
30       • key - path to the key file.
31
32       • cert - path to the certificate file.
33
34       • ca - path to the certificate authority file.
35
36       • capath - path to the directory containing the trusted TLS CA certifi‐
37         cates in PEM format.
38
39       • cipher list of permitted (SSLv3, TLSv1.0 or TLSv1.2) cipher suites to
40         use for TLS encryption.
41
42   Notes
43mysql_real_connect(3)  will  return an error if attempting to connect
44         and TLS is incorrectly set up.
45
46       • Even if Connector/C supports TLSv1.3 protocol, it is not possible yet
47         to specify TLSv1.3 cipher suites via cipher parameter.
48
49   See also
50mysql_get_ssl_cipher(3)
51
52
53
54Version 3.3.1                                                 mysql_ssl_set(3)
Impressum