ent 9154 mysql ssl console connection

This commit is contained in:
edu.corral 2022-09-15 12:58:33 +02:00
parent aea2dd5075
commit b3054b6ab2
2 changed files with 3 additions and 3 deletions

View File

@ -43,7 +43,7 @@
* This is used to configure MySQL SSL console connection
* $config["dbssl"]=0;
* $config["dbsslcafile"]="/path/ca-cert.pem";
* $config["sslverifyservercert"]=0;
* $config["sslverifyservercert"]=1;
*/
// By default report any error but notices.

View File

@ -62,7 +62,7 @@ function mysql_connect_db(
}
if ($verify === null && (bool) $config['sslverifyservercert'] === true) {
$verify = 'ignore verify';
$verify = 'verified';
}
// Check if mysqli is available
@ -92,7 +92,7 @@ function mysql_connect_db(
mysqli_ssl_set($connect_id, null, null, $ssl, null, null);
if ($verify === null) {
if ($verify === 'verified') {
mysqli_real_connect($connect_id, $host, $user, $pass, $db, $port, null, MYSQLI_CLIENT_SSL);
} else {
mysqli_real_connect($connect_id, $host, $user, $pass, $db, $port, null, MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT);