From 4e2ba74786f972d1843ec6183fa446feaedc906f Mon Sep 17 00:00:00 2001 From: Xiao Yu Date: Sat, 10 Sep 2016 19:21:13 +0000 Subject: [PATCH] Only set MySQL SSL opts if secure connections are requested --- lib/admin.php | 2 +- lib/db.php | 5 ++++- lib/dropin.php | 2 +- readme.txt | 8 ++++++-- secure-db-connection.php | 2 +- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/admin.php b/lib/admin.php index 3f6d08a..94eda38 100644 --- a/lib/admin.php +++ b/lib/admin.php @@ -6,7 +6,7 @@ * Author: Xiao Yu * Author URI: http://xyu.io/ * Text Domain: secure-db-connection - * Version: 1.1.1 + * Version: 1.1.2 */ if ( ! defined( 'ABSPATH' ) ) { diff --git a/lib/db.php b/lib/db.php index a428beb..4a179eb 100644 --- a/lib/db.php +++ b/lib/db.php @@ -5,7 +5,7 @@ * Description: Sets SSL keys and certs for encrypted database connections * Author: Xiao Yu * Author URI: http://xyu.io/ - * Version: 1.1.1 + * Version: 1.1.2 */ if ( ! defined( 'ABSPATH' ) ) { @@ -74,6 +74,9 @@ public function db_connect( $allow_bail = true ) { break; } } + if ( MYSQLI_CLIENT_SSL !== ( $client_flags & MYSQLI_CLIENT_SSL ) ) { + $ssl_opts_set = false; + } if ( $ssl_opts_set ) { mysqli_ssl_set( $this->dbh, diff --git a/lib/dropin.php b/lib/dropin.php index a53a8ef..7eb8424 100644 --- a/lib/dropin.php +++ b/lib/dropin.php @@ -6,7 +6,7 @@ * Author: Xiao Yu * Author URI: http://xyu.io/ * Text Domain: secure-db-connection - * Version: 1.1.1 + * Version: 1.1.2 */ if ( ! defined( 'ABSPATH' ) ) { diff --git a/readme.txt b/readme.txt index 889a9bd..c1d7c9a 100644 --- a/readme.txt +++ b/readme.txt @@ -2,8 +2,8 @@ Contributors: HypertextRanch Tags: db, mysql, secure, encrypted, ssl Requires at least: 3.9 -Tested up to: 4.6 -Stable tag: 1.1.1 +Tested up to: 4.6.1 +Stable tag: 1.1.2 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -65,6 +65,10 @@ For detailed installation instructions, please read the [standard installation p == Changelog == += 1.1.2 = + + * Only set MySQL SSL opts if secure connections are requested. + = 1.1.1 = * Retag release to fix version inconsistency diff --git a/secure-db-connection.php b/secure-db-connection.php index 230cac5..2cc0ba4 100644 --- a/secure-db-connection.php +++ b/secure-db-connection.php @@ -6,7 +6,7 @@ * Author: Xiao Yu * Author URI: http://xyu.io/ * Text Domain: secure-db-connection - * Version: 1.1.1 + * Version: 1.1.2 */ if ( ! defined( 'ABSPATH' ) ) {