Skip to content

Commit

Permalink
Only set MySQL SSL opts if secure connections are requested
Browse files Browse the repository at this point in the history
  • Loading branch information
xyu committed Sep 10, 2016
1 parent 2af8f60 commit 4e2ba74
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) ) {
Expand Down
5 changes: 4 additions & 1 deletion lib/db.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) ) {
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/dropin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) ) {
Expand Down
8 changes: 6 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion secure-db-connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) ) {
Expand Down

0 comments on commit 4e2ba74

Please sign in to comment.