Skip to content

Commit 4e2ba74

Browse files
committed
Only set MySQL SSL opts if secure connections are requested
1 parent 2af8f60 commit 4e2ba74

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

lib/admin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Author: Xiao Yu
77
* Author URI: http://xyu.io/
88
* Text Domain: secure-db-connection
9-
* Version: 1.1.1
9+
* Version: 1.1.2
1010
*/
1111

1212
if ( ! defined( 'ABSPATH' ) ) {

lib/db.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Description: Sets SSL keys and certs for encrypted database connections
66
* Author: Xiao Yu
77
* Author URI: http://xyu.io/
8-
* Version: 1.1.1
8+
* Version: 1.1.2
99
*/
1010

1111
if ( ! defined( 'ABSPATH' ) ) {
@@ -74,6 +74,9 @@ public function db_connect( $allow_bail = true ) {
7474
break;
7575
}
7676
}
77+
if ( MYSQLI_CLIENT_SSL !== ( $client_flags & MYSQLI_CLIENT_SSL ) ) {
78+
$ssl_opts_set = false;
79+
}
7780
if ( $ssl_opts_set ) {
7881
mysqli_ssl_set(
7982
$this->dbh,

lib/dropin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Author: Xiao Yu
77
* Author URI: http://xyu.io/
88
* Text Domain: secure-db-connection
9-
* Version: 1.1.1
9+
* Version: 1.1.2
1010
*/
1111

1212
if ( ! defined( 'ABSPATH' ) ) {

readme.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Contributors: HypertextRanch
33
Tags: db, mysql, secure, encrypted, ssl
44
Requires at least: 3.9
5-
Tested up to: 4.6
6-
Stable tag: 1.1.1
5+
Tested up to: 4.6.1
6+
Stable tag: 1.1.2
77
License: GPLv3
88
License URI: http://www.gnu.org/licenses/gpl-3.0.html
99

@@ -65,6 +65,10 @@ For detailed installation instructions, please read the [standard installation p
6565

6666
== Changelog ==
6767

68+
= 1.1.2 =
69+
70+
* Only set MySQL SSL opts if secure connections are requested.
71+
6872
= 1.1.1 =
6973

7074
* Retag release to fix version inconsistency

secure-db-connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Author: Xiao Yu
77
* Author URI: http://xyu.io/
88
* Text Domain: secure-db-connection
9-
* Version: 1.1.1
9+
* Version: 1.1.2
1010
*/
1111

1212
if ( ! defined( 'ABSPATH' ) ) {

0 commit comments

Comments
 (0)