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;
}
* @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',