X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=Civi%2FInstall%2FRequirements.php;h=7d30855076b79c0380a1d6746f7deece5ce0e2b0;hb=04b1abad5dcf19ec18dc9bca9e04af2e2c618d59;hp=d5f3d648ebf242cd23a90146144b54c63c8f7d18;hpb=e8a38180f348561312bdcb0c5cdc94f505385cff;p=civicrm-core.git diff --git a/Civi/Install/Requirements.php b/Civi/Install/Requirements.php index d5f3d648eb..7d30855076 100644 --- a/Civi/Install/Requirements.php +++ b/Civi/Install/Requirements.php @@ -132,7 +132,24 @@ class Requirements { elseif (!empty($db_config['server'])) { $host = $db_config['server']; } - $conn = @mysqli_connect($host, $db_config['username'], $db_config['password'], $db_config['database'], !empty($db_config['port']) ? $db_config['port'] : NULL); + if (empty($db_config['ssl_params'])) { + $conn = @mysqli_connect($host, $db_config['username'], $db_config['password'], $db_config['database'], !empty($db_config['port']) ? $db_config['port'] : NULL); + } + else { + $conn = NULL; + $init = mysqli_init(); + mysqli_ssl_set( + $init, + $db_config['ssl_params']['key'] ?? NULL, + $db_config['ssl_params']['cert'] ?? NULL, + $db_config['ssl_params']['ca'] ?? NULL, + $db_config['ssl_params']['capath'] ?? NULL, + $db_config['ssl_params']['cipher'] ?? NULL + ); + if (@mysqli_real_connect($init, $host, $db_config['username'], $db_config['password'], $db_config['database'], (!empty($db_config['port']) ? $db_config['port'] : NULL), NULL, MYSQLI_CLIENT_SSL)) { + $conn = $init; + } + } return $conn; } @@ -303,6 +320,9 @@ class Requirements { * @return array */ public function checkMysqlVersion(array $db_config) { + if (!class_exists('\CRM_Upgrade_Incremental_General')) { + require_once dirname(__FILE__) . '/../../CRM/Upgrade/Incremental/General.php'; + } $min = \CRM_Upgrade_Incremental_General::MIN_INSTALL_MYSQL_VER; $results = [ 'title' => 'CiviCRM MySQL Version',