Skip to content

Commit

Permalink
fix: Apply certificate check option as default request param
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Knorr <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Dec 30, 2024
1 parent d87dd1c commit 1cb3036
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/Service/RemoteOptionsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 1cb3036

Please sign in to comment.