diff options
author | Julius Härtl <jus@bitgrid.net> | 2020-06-25 16:49:12 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-25 16:49:12 +0300 |
commit | 4447d0fed002782052586a989bd3b47d5e218e28 (patch) | |
tree | d1b937025feb951461270344b382ffeffe039b56 | |
parent | 692ee8e208039240efada910cf9972e80426e717 (diff) | |
parent | 3e53a966c320548162d991ef43b72420b5cc4c72 (diff) |
Merge pull request #1059 from nextcloud/bugfix/noid/certificate-store
-rw-r--r-- | lib/Controller/SettingsController.php | 2 | ||||
-rw-r--r-- | lib/Preview/Office.php | 4 | ||||
-rw-r--r-- | lib/Service/CapabilitiesService.php | 4 | ||||
-rw-r--r-- | lib/Settings/Admin.php | 2 | ||||
-rw-r--r-- | lib/WOPI/DiscoveryManager.php | 4 |
5 files changed, 11 insertions, 5 deletions
diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index 99476a74..24a7f1ad 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -114,7 +114,7 @@ class SettingsController extends Controller{ return new JSONResponse([ 'wopi_url' => $this->appConfig->getAppValue('wopi_url'), 'public_wopi_url' => $this->appConfig->getAppValue('public_wopi_url'), - 'disable_certificate_verification' => $this->appConfig->getAppValue('disable_certificate_verification', '') !== '', + 'disable_certificate_verification' => $this->appConfig->getAppValue('disable_certificate_verification') === 'yes', 'edit_groups' => $this->appConfig->getAppValue('edit_groups'), 'use_groups' => $this->appConfig->getAppValue('use_groups'), 'doc_format' => $this->appConfig->getAppValue('doc_format'), diff --git a/lib/Preview/Office.php b/lib/Preview/Office.php index 8b6e421b..f3f8af01 100644 --- a/lib/Preview/Office.php +++ b/lib/Preview/Office.php @@ -82,7 +82,9 @@ abstract class Office extends Provider { $client = $this->clientService->newClient(); $options = ['timeout' => 10]; - $options['verify'] = $this->config->getAppValue('richdocuments', 'disable_certificate_verification', '') === ''; + if ($this->config->getAppValue('richdocuments', 'disable_certificate_verification') === 'yes') { + $options['verify'] = false; + } $options['multipart'] = [['name' => $path, 'contents' => $stream]]; diff --git a/lib/Service/CapabilitiesService.php b/lib/Service/CapabilitiesService.php index 8cdd3264..41fb78eb 100644 --- a/lib/Service/CapabilitiesService.php +++ b/lib/Service/CapabilitiesService.php @@ -119,7 +119,9 @@ class CapabilitiesService { $client = $this->clientService->newClient(); $options = ['timeout' => 45, 'nextcloud' => ['allow_local_address' => true]]; - $options['verify'] = $this->config->getAppValue('richdocuments', 'disable_certificate_verification', '') === ''; + if ($this->config->getAppValue('richdocuments', 'disable_certificate_verification') === 'yes') { + $options['verify'] = false; + } try { $response = $client->get($capabilitiesEndpoint, $options); diff --git a/lib/Settings/Admin.php b/lib/Settings/Admin.php index 4243ddfd..b27e8138 100644 --- a/lib/Settings/Admin.php +++ b/lib/Settings/Admin.php @@ -85,7 +85,7 @@ class Admin implements ISettings { 'doc_format' => $this->config->getAppValue('richdocuments', 'doc_format'), 'external_apps' => $this->config->getAppValue('richdocuments', 'external_apps'), 'canonical_webroot' => $this->config->getAppValue('richdocuments', 'canonical_webroot'), - 'disable_certificate_verification' => $this->config->getAppValue('richdocuments', 'disable_certificate_verification', '') !== '', + 'disable_certificate_verification' => $this->config->getAppValue('richdocuments', 'disable_certificate_verification', '') === 'yes', 'templates' => $this->manager->getSystemFormatted(), 'templatesAvailable' => array_key_exists('templates', $this->capabilities) && $this->capabilities['templates'], 'settings' => $this->appConfig->getAppSettings(), diff --git a/lib/WOPI/DiscoveryManager.php b/lib/WOPI/DiscoveryManager.php index 90a38d36..8c6075cc 100644 --- a/lib/WOPI/DiscoveryManager.php +++ b/lib/WOPI/DiscoveryManager.php @@ -98,7 +98,9 @@ class DiscoveryManager { $client = $this->clientService->newClient(); $options = ['timeout' => 45, 'nextcloud' => ['allow_local_address' => true]]; - $options['verify'] = $this->config->getAppValue('richdocuments', 'disable_certificate_verification', '') === ''; + if ($this->config->getAppValue('richdocuments', 'disable_certificate_verification') === 'yes') { + $options['verify'] = false; + } try { return $client->get($wopiDiscovery, $options); |