Skip to content

Commit 1bf5a3b

Browse files
committed
MySQL 5.6.36 and above also has full SSL support
1 parent ad56ca4 commit 1bf5a3b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/mysql2/client.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ struct nogvl_select_db_args {
121121
static VALUE rb_set_ssl_mode_option(VALUE self, VALUE setting) {
122122
unsigned long version = mysql_get_client_version();
123123

124-
if (version < 50703) {
125-
rb_warn( "Your mysql client library does not support setting ssl_mode; full support comes with 5.7.11." );
124+
if (version < 50630 || (version >= 50700 && version < 50703)) {
125+
rb_warn( "Your mysql client library does not support setting ssl_mode; full support comes with 5.6.36+, 5.7.11+, 8.0+" );
126126
return Qnil;
127127
}
128128
#if defined(HAVE_CONST_MYSQL_OPT_SSL_VERIFY_SERVER_CERT) || defined(HAVE_CONST_MYSQL_OPT_SSL_ENFORCE)
@@ -1723,7 +1723,7 @@ void init_mysql2_client() {
17231723
rb_const_set(cMysql2Client, rb_intern("SESSION_TRACK_TRANSACTION_STATE"), INT2NUM(SESSION_TRACK_TRANSACTION_STATE));
17241724
#endif
17251725

1726-
#if defined(FULL_SSL_MODE_SUPPORT) // MySQL 5.7.11 and above
1726+
#if defined(FULL_SSL_MODE_SUPPORT) // MySQL 5.6.36 and MySQL 5.7.11 and above
17271727
rb_const_set(cMysql2Client, rb_intern("SSL_MODE_DISABLED"), INT2NUM(SSL_MODE_DISABLED));
17281728
rb_const_set(cMysql2Client, rb_intern("SSL_MODE_PREFERRED"), INT2NUM(SSL_MODE_PREFERRED));
17291729
rb_const_set(cMysql2Client, rb_intern("SSL_MODE_REQUIRED"), INT2NUM(SSL_MODE_REQUIRED));

0 commit comments

Comments
 (0)