Skip to content

Commit

Permalink
Merge pull request #1896 from atishamte/mysql_connection
Browse files Browse the repository at this point in the history
Mysql connection issue with MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT #1219
  • Loading branch information
lonnieezell authored Apr 1, 2019
2 parents 87d848c + 9b36d7f commit e80811a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions system/Database/MySQLi/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@ public function connect($persistent = false)
//
// https://secure.php.net/ChangeLog-5.php#5.6.16
// https://bugs.php.net/bug.php?id=68344
elseif (defined('MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT'))
elseif (defined('MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT') && version_compare($this->mysqli->client_info, '5.6', '>='))
{
$this->mysqli->options(MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT, true);
$client_flags += MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT;
}
}

$client_flags |= MYSQLI_CLIENT_SSL;
$client_flags += MYSQLI_CLIENT_SSL;
$this->mysqli->ssl_set(
$ssl['key'] ?? null, $ssl['cert'] ?? null, $ssl['ca'] ?? null,
$ssl['capath'] ?? null, $ssl['cipher'] ?? null
Expand Down

0 comments on commit e80811a

Please sign in to comment.