From 13f5824bed674bb926f3d9ae7893150a74f14937 Mon Sep 17 00:00:00 2001 From: Tatevik Date: Wed, 6 May 2026 16:55:49 +0400 Subject: [PATCH] add SSL connection check option --- public_html/lists/admin/mysqli.inc | 7 ++++++- public_html/lists/config/config_extended.php | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/public_html/lists/admin/mysqli.inc b/public_html/lists/admin/mysqli.inc index 29c900890..274ac76e8 100644 --- a/public_html/lists/admin/mysqli.inc +++ b/public_html/lists/admin/mysqli.inc @@ -20,7 +20,12 @@ function Sql_Connect($host, $user, $password, $database) } $db = mysqli_init(); $compress = empty($database_connection_compression) ? 0 : MYSQLI_CLIENT_COMPRESS; - $secure = empty($database_connection_ssl) ? 0 : MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT; + $secure = 0; + if (!empty($database_connection_ssl)) { + $secure = !empty($database_connection_ssl_check) + ? MYSQLI_CLIENT_SSL + : MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT; + } mysqli_report(MYSQLI_REPORT_OFF); diff --git a/public_html/lists/config/config_extended.php b/public_html/lists/config/config_extended.php index b0ab027c4..53b1e867c 100644 --- a/public_html/lists/config/config_extended.php +++ b/public_html/lists/config/config_extended.php @@ -41,6 +41,9 @@ // force database connection to use SSL $database_connection_ssl = false; +// force to check SSL connection +$database_connection_ssl_check = false; + // if you use multiple installations of phpList you can set this to // something to identify this one. it will be prepended to email report // subjects