From 14fc71427d80eac2e17499111e4098bece07e651 Mon Sep 17 00:00:00 2001 From: Erawat Chamanont Date: Thu, 29 Jul 2021 21:25:40 +0100 Subject: [PATCH] dev/core#2726 - Set ssl option when using DSN with SSL --- CRM/Utils/File.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CRM/Utils/File.php b/CRM/Utils/File.php index 79bbbd4dfc..d50ee48d77 100644 --- a/CRM/Utils/File.php +++ b/CRM/Utils/File.php @@ -327,7 +327,8 @@ class CRM_Utils_File { 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()); -- 2.25.1