From d715fc0907b23a421214e49f5fcabc95fb76420c Mon Sep 17 00:00:00 2001 From: RomanL Date: Wed, 13 Oct 2021 10:54:52 +0300 Subject: [PATCH] #3532 Add option in developer to trust unsigned certificates or not verified hosts --- inc/utils.inc.php | 5 +++++ install/sql/system.sql | 3 ++- modules/boonex/english/data/langs/system/en.xml | 3 ++- modules/boonex/russian/data/langs/system/ru.xml | 3 ++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/inc/utils.inc.php b/inc/utils.inc.php index 26482c93d6..8714692f6a 100644 --- a/inc/utils.inc.php +++ b/inc/utils.inc.php @@ -907,6 +907,11 @@ function bx_file_get_contents($sFileUrl, $aParams = array(), $sMethod = 'get', $ curl_setopt($rConnect, CURLOPT_CONNECTTIMEOUT, $iTimeout); curl_setopt($rConnect, CURLOPT_TIMEOUT, $iTimeout); } + + if(getParam('curl_ssl_allow_untrusted') == 'on'){ + curl_setopt($rConnect, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($rConnect, CURLOPT_SSL_VERIFYHOST, false); + } if (!ini_get('open_basedir')) curl_setopt($rConnect, CURLOPT_FOLLOWLOCATION, 1); diff --git a/install/sql/system.sql b/install/sql/system.sql index 5cd8781f88..4ca27f616d 100644 --- a/install/sql/system.sql +++ b/install/sql/system.sql @@ -339,7 +339,8 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `ex (@iCategoryId, 'sys_logs_storage_default', '_adm_stg_cpt_option_sys_logs_storage_default', 'Folder', 'select', 'Folder,PHPLog,STDErr', '', '', '', 130), -(@iCategoryId, 'sys_default_curl_timeout', '_adm_stg_cpt_option_sys_default_curl_timeout', '300', 'digit', '', '', '', '', 140); +(@iCategoryId, 'sys_default_curl_timeout', '_adm_stg_cpt_option_sys_default_curl_timeout', '300', 'digit', '', '', '', '', 140), +(@iCategoryId, 'curl_ssl_allow_untrusted', '_adm_stg_cpt_option_sys_ssl_allow_untrusted', '', 'checkbox', '', '', '', '', 145); -- -- CATEGORY (HIDDEN): System diff --git a/modules/boonex/english/data/langs/system/en.xml b/modules/boonex/english/data/langs/system/en.xml index a1b032e241..94322ee6b1 100644 --- a/modules/boonex/english/data/langs/system/en.xml +++ b/modules/boonex/english/data/langs/system/en.xml @@ -1604,7 +1604,8 @@ - + + diff --git a/modules/boonex/russian/data/langs/system/ru.xml b/modules/boonex/russian/data/langs/system/ru.xml index 61fd8c3f02..f08a16257d 100644 --- a/modules/boonex/russian/data/langs/system/ru.xml +++ b/modules/boonex/russian/data/langs/system/ru.xml @@ -1588,7 +1588,8 @@ - + +