Skip to content

Commit

Permalink
CIVIPLUS-150: Set ssl option when using DSN with SSL
Browse files Browse the repository at this point in the history
Included CiviCRM 5.41.0

PR: civicrm#20974
  • Loading branch information
erawat committed Jul 30, 2021
1 parent f58e729 commit 60a8708
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CRM/Utils/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,8 @@ public static function runSqlQuery($dsn, $queryString, $prefix = NULL, $dieOnErr
require_once 'DB.php';
$dsn = CRM_Utils_SQL::autoSwitchDSN($dsn);
try {
$db = DB::connect($dsn);
$options = CRM_Utils_SQL::isSSLDSN($dsn) ? ['ssl' => TRUE] : [];
$db = DB::connect($dsn, $options);
}
catch (Exception $e) {
die("Cannot open $dsn: " . $e->getMessage());
Expand Down

0 comments on commit 60a8708

Please sign in to comment.