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; + } }