From: Pavel Železný Date: Sat, 2 Dec 2023 13:36:39 +0000 (+0100) Subject: Fix mysqli ssl without server certificate X-Git-Tag: v4.16.0~10 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=7c9fec4e6b575a9a16d2239a8661a769144ce6e9;p=adminer.git Fix mysqli ssl without server certificate --- diff --git a/adminer/drivers/mysql.inc.php b/adminer/drivers/mysql.inc.php index 291a2d41..24c95eea 100644 --- a/adminer/drivers/mysql.inc.php +++ b/adminer/drivers/mysql.inc.php @@ -27,7 +27,7 @@ if (!defined("DRIVER")) { $database, (is_numeric($port) ? $port : ini_get("mysqli.default_port")), (!is_numeric($port) ? $port : $socket), - ($ssl ? 64 : 0) // 64 - MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT (not available before PHP 5.6.16) + ($ssl ? (empty($ssl['cert']) ? 2048 : 64) : 0) // 2048 - MYSQLI_CLIENT_SSL, 64 - MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT (not available before PHP 5.6.16) ); $this->options(MYSQLI_OPT_LOCAL_INFILE, false); return $return; @@ -50,7 +50,7 @@ if (!defined("DRIVER")) { $row = $result->fetch_array(); return $row[$field]; } - + function quote($string) { return "'" . $this->escape_string($string) . "'"; } @@ -308,7 +308,7 @@ if (!defined("DRIVER")) { } return queries($prefix . implode(",\n", $values) . $suffix); } - + function slowQuery($query, $timeout) { if (min_version('5.7.8', '10.1.2')) { if (preg_match('~MariaDB~', $this->_conn->server_info)) { @@ -325,7 +325,7 @@ if (!defined("DRIVER")) { : $idf ); } - + function warnings() { $result = $this->_conn->query("SHOW WARNINGS"); if ($result && $result->num_rows) {