@@ -69,7 +69,7 @@ static ID intern_brackets, intern_merge, intern_merge_bang, intern_new_with_args
69
69
#endif
70
70
71
71
/*
72
- * compatibility with mysql-connector-c 6.1.x, and with MySQL 5.7.3 - 5.7.10.
72
+ * compatibility with mysql-connector-c 6.1.x, MySQL 5.7.3 - 5.7.10 & with MariaDB 10.x and later .
73
73
*/
74
74
#ifdef HAVE_CONST_MYSQL_OPT_SSL_VERIFY_SERVER_CERT
75
75
#define SSL_MODE_VERIFY_IDENTITY 5
@@ -128,8 +128,8 @@ static VALUE rb_set_ssl_mode_option(VALUE self, VALUE setting) {
128
128
#if defined(HAVE_CONST_MYSQL_OPT_SSL_VERIFY_SERVER_CERT ) || defined(HAVE_CONST_MYSQL_OPT_SSL_ENFORCE )
129
129
GET_CLIENT (self );
130
130
int val = NUM2INT ( setting );
131
- // Either MySQL 5.7.3 - 5.7.10, or Connector/C 6.1.3 - 6.1.x, or MariaDB 10.x
132
- if ((version >= 50703 && version < 50711 ) || (version >= 60103 && version < 60200 ) || ( version >= 100000 && version < 110000 ) ) {
131
+ // Either MySQL 5.7.3 - 5.7.10, or Connector/C 6.1.3 - 6.1.x, or MariaDB 10.x and later
132
+ if ((version >= 50703 && version < 50711 ) || (version >= 60103 && version < 60200 ) || version >= 100000 ) {
133
133
#ifdef HAVE_CONST_MYSQL_OPT_SSL_VERIFY_SERVER_CERT
134
134
if (val == SSL_MODE_VERIFY_IDENTITY ) {
135
135
my_bool b = 1 ;
@@ -1690,10 +1690,10 @@ void init_mysql2_client() {
1690
1690
rb_const_set (cMysql2Client , rb_intern ("SSL_MODE_VERIFY_CA" ), INT2NUM (SSL_MODE_VERIFY_CA ));
1691
1691
rb_const_set (cMysql2Client , rb_intern ("SSL_MODE_VERIFY_IDENTITY" ), INT2NUM (SSL_MODE_VERIFY_IDENTITY ));
1692
1692
#else
1693
- #ifdef HAVE_CONST_MYSQL_OPT_SSL_VERIFY_SERVER_CERT // MySQL 5.7.3 - 5.7.10
1693
+ #ifdef HAVE_CONST_MYSQL_OPT_SSL_VERIFY_SERVER_CERT // MySQL 5.7.3 - 5.7.10 & MariaDB 10.x and later
1694
1694
rb_const_set (cMysql2Client , rb_intern ("SSL_MODE_VERIFY_IDENTITY" ), INT2NUM (SSL_MODE_VERIFY_IDENTITY ));
1695
1695
#endif
1696
- #ifdef HAVE_CONST_MYSQL_OPT_SSL_ENFORCE // MySQL 5.7.3 - 5.7.10
1696
+ #ifdef HAVE_CONST_MYSQL_OPT_SSL_ENFORCE // MySQL 5.7.3 - 5.7.10 & MariaDB 10.x and later
1697
1697
rb_const_set (cMysql2Client , rb_intern ("SSL_MODE_DISABLED" ), INT2NUM (SSL_MODE_DISABLED ));
1698
1698
rb_const_set (cMysql2Client , rb_intern ("SSL_MODE_REQUIRED" ), INT2NUM (SSL_MODE_REQUIRED ));
1699
1699
#endif
0 commit comments