View | Details | Raw Unified | Return to bug 226266
Collapse All | Expand All

(-)src/global/dict_mysql.c (-4 / +13 lines)
Lines 198-203 Link Here
198
198
199
#include "dict_mysql.h"
199
#include "dict_mysql.h"
200
200
201
/* MySQL 8.x API change */
202
203
#if MYSQL_VERSION_ID >= 80000 && !defined(MARIADB_BASE_VERSION)
204
#define DICT_MYSQL_SSL_VERIFY_SERVER_CERT MYSQL_OPT_SSL_MODE
205
#elif MYSQL_VERSION_ID >= 50023
206
#define DICT_MYSQL_SSL_VERIFY_SERVER_CERT MYSQL_OPT_SSL_VERIFY_SERVER_CERT
207
#endif
208
209
201
/* need some structs to help organize things */
210
/* need some structs to help organize things */
202
typedef struct {
211
typedef struct {
203
    MYSQL  *db;
212
    MYSQL  *db;
Lines 237-243 typedef struct { Link Here
237
    char   *tls_CAfile;
246
    char   *tls_CAfile;
238
    char   *tls_CApath;
247
    char   *tls_CApath;
239
    char   *tls_ciphers;
248
    char   *tls_ciphers;
240
#if MYSQL_VERSION_ID >= 50023
249
#if defined(DICT_MYSQL_SSL_VERIFY_SERVER_CERT)
241
    int     tls_verify_cert;
250
    int     tls_verify_cert;
242
#endif
251
#endif
243
#endif
252
#endif
Lines 656-664 static void plmysql_connect_single(DICT_ Link Here
656
		      dict_mysql->tls_key_file, dict_mysql->tls_cert_file,
665
		      dict_mysql->tls_key_file, dict_mysql->tls_cert_file,
657
		      dict_mysql->tls_CAfile, dict_mysql->tls_CApath,
666
		      dict_mysql->tls_CAfile, dict_mysql->tls_CApath,
658
		      dict_mysql->tls_ciphers);
667
		      dict_mysql->tls_ciphers);
659
#if MYSQL_VERSION_ID >= 50023
668
#if defined(DICT_MYSQL_SSL_VERIFY_SERVER_CERT)
660
    if (dict_mysql->tls_verify_cert != -1)
669
    if (dict_mysql->tls_verify_cert != -1)
661
	mysql_options(host->db, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
670
         mysql_options(host->db, DICT_MYSQL_SSL_VERIFY_SERVER_CERT,
662
		      &dict_mysql->tls_verify_cert);
671
		      &dict_mysql->tls_verify_cert);
663
#endif
672
#endif
664
#endif
673
#endif
Lines 723-729 static void mysql_parse_config(DICT_MYSQ Link Here
723
    dict_mysql->tls_CAfile = cfg_get_str(p, "tls_CAfile", NULL, 0, 0);
732
    dict_mysql->tls_CAfile = cfg_get_str(p, "tls_CAfile", NULL, 0, 0);
724
    dict_mysql->tls_CApath = cfg_get_str(p, "tls_CApath", NULL, 0, 0);
733
    dict_mysql->tls_CApath = cfg_get_str(p, "tls_CApath", NULL, 0, 0);
725
    dict_mysql->tls_ciphers = cfg_get_str(p, "tls_ciphers", NULL, 0, 0);
734
    dict_mysql->tls_ciphers = cfg_get_str(p, "tls_ciphers", NULL, 0, 0);
726
#if MYSQL_VERSION_ID >= 50023
735
#if defined(DICT_MYSQL_SSL_VERIFY_SERVER_CERT)
727
    dict_mysql->tls_verify_cert = cfg_get_bool(p, "tls_verify_cert", -1);
736
    dict_mysql->tls_verify_cert = cfg_get_bool(p, "tls_verify_cert", -1);
728
#endif
737
#endif
729
#endif
738
#endif

Return to bug 226266