From 4cbd82d750c6aa1b09ab0feabedeb343274f1485 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Fri, 28 Feb 2020 14:19:22 +0000 Subject: [PATCH] remove empty settings so not all SSL things are required for using SSL with MySQL --- functions.inc.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/functions.inc.php b/functions.inc.php index 6929379e..ee1f5fa5 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -1517,10 +1517,12 @@ function db_connect() { $dsn = "mysql:host={$CONF['database_host']};dbname={$database_name};charset=UTF8"; } if (Config::bool('database_use_ssl')) { + $options[PDO::MYSQL_ATTR_SSL_KEY] = Config::read_string('database_ssl_key'); $options[PDO::MYSQL_ATTR_SSL_CA] = Config::read_string('database_ssl_ca'); $options[PDO::MYSQL_ATTR_SSL_CAPATH] = Config::read_string('database_ssl_ca_path'); $options[PDO::MYSQL_ATTR_SSL_CERT] = Config::read_string('database_ssl_cert'); $options[PDO::MYSQL_ATTR_SSL_CIPHER] = Config::read_string('database_ssl_cipher'); + $options = array_filter($options); // remove empty settings. } $queries[] = 'SET CHARACTER SET utf8'; $queries[] = "SET COLLATION_CONNECTION='utf8_general_ci'";