aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/External
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-10-11 11:52:10 +0200
committerJoas Schilling <coding@schilljs.com>2023-10-11 11:52:10 +0200
commit91ebbe80037d13890d680e697593fbe7eed777cb (patch)
treee4f7ae37615f9ea2cb26e8dde0a917b50c3cea40 /apps/files_sharing/lib/External
parent04db454e9fc57483595e90dee348904acd4315ca (diff)
downloadnextcloud-server-91ebbe80037d13890d680e697593fbe7eed777cb.tar.gz
nextcloud-server-91ebbe80037d13890d680e697593fbe7eed777cb.zip
fix(federation): Use `sharing.federation.allowSelfSignedCertificates` config for all OCM requests
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/files_sharing/lib/External')
-rw-r--r--apps/files_sharing/lib/External/Storage.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/External/Storage.php b/apps/files_sharing/lib/External/Storage.php
index e3fe9c7f51e..7b64690d53e 100644
--- a/apps/files_sharing/lib/External/Storage.php
+++ b/apps/files_sharing/lib/External/Storage.php
@@ -53,6 +53,7 @@ use OCP\Files\StorageNotAvailableException;
use OCP\Http\Client\IClientService;
use OCP\Http\Client\LocalServerException;
use OCP\ICacheFactory;
+use OCP\IConfig;
use OCP\OCM\Exceptions\OCMArgumentException;
use OCP\OCM\Exceptions\OCMProviderException;
use OCP\OCM\IOCMDiscoveryService;
@@ -67,6 +68,7 @@ class Storage extends DAV implements ISharedStorage, IDisableEncryptionStorage,
private IClientService $httpClient;
private bool $updateChecked = false;
private ExternalShareManager $manager;
+ private IConfig $config;
/**
* @param array{HttpClientService: IClientService, manager: ExternalShareManager, cloudId: ICloudId, mountpoint: string, token: string, password: ?string}|array $options
@@ -78,6 +80,7 @@ class Storage extends DAV implements ISharedStorage, IDisableEncryptionStorage,
$this->cloudId = $options['cloudId'];
$this->logger = Server::get(LoggerInterface::class);
$discoveryService = Server::get(IOCMDiscoveryService::class);
+ $this->config = Server::get(IConfig::class);
// use default path to webdav if not found on discovery
try {
@@ -290,6 +293,7 @@ class Storage extends DAV implements ISharedStorage, IDisableEncryptionStorage,
$result = $client->get($url, [
'timeout' => 10,
'connect_timeout' => 10,
+ 'verify' => !$this->config->getSystemValueBool('sharing.federation.allowSelfSignedCertificates', false),
])->getBody();
$data = json_decode($result);
$returnValue = (is_object($data) && !empty($data->version));