From 1cb3036996ec855402f079dee320be97aa98a375 Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Fri, 27 Dec 2024 12:25:19 +0100 Subject: [PATCH] fix: Apply certificate check option as default request param Signed-off-by: Julius Knorr --- lib/Service/RemoteOptionsService.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/Service/RemoteOptionsService.php b/lib/Service/RemoteOptionsService.php index 860e832f56..5a20ffc2d7 100644 --- a/lib/Service/RemoteOptionsService.php +++ b/lib/Service/RemoteOptionsService.php @@ -8,16 +8,23 @@ namespace OCA\Richdocuments\Service; +use OCP\IAppConfig; + class RemoteOptionsService { public const REMOTE_TIMEOUT_DEFAULT = 5; public static function getDefaultOptions(int $timeout = self::REMOTE_TIMEOUT_DEFAULT): array { - return [ + $options = [ 'timeout' => $timeout, 'nextcloud' => [ 'allow_local_address' => true, ] ]; - } + if (\OCP\Server::get(IAppConfig::class)->getValueString('richdocuments', 'disable_certificate_verification') === 'yes') { + $options['verify'] = false; + } + + return $options; + } }