if ($this->mysqli->
real_connect( $hostname,
$this->username,
$this->password,
$this->database,
$port,
$socket,
$clientFlags )) { // Prior to version 5.7.3, MySQL silently downgrades to an unencrypted connection if SSL setup fails
if (($clientFlags & MYSQLI_CLIENT_SSL
) &&
version_compare($this->mysqli->client_info, 'mysqlnd 5.7.3', '<='
) &&
empty($this->mysqli->
query("SHOW STATUS LIKE 'ssl_cipher'"
)->
fetch_object()->Value
) ) { $this->mysqli->
close();
$message = 'MySQLi was configured for an SSL connection, but got an unencrypted connection instead!';
log_message('error',
$message);
if ($this->DBDebug
) { throw new DatabaseException($message);
} return false;
}