X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=Civi%2FInstall%2FRequirements.php;h=7d30855076b79c0380a1d6746f7deece5ce0e2b0;hb=04b1abad5dcf19ec18dc9bca9e04af2e2c618d59;hp=da7b2cc76597194238bff22058288b01ed11c268;hpb=b7fa17aa5d70adde61fdfc4b8349333af92255f1;p=civicrm-core.git diff --git a/Civi/Install/Requirements.php b/Civi/Install/Requirements.php index da7b2cc765..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; }