Skip to content

Commit

Permalink
Revert "Disable certificate verification handling"
Browse files Browse the repository at this point in the history
This reverts commit 5a59060.
  • Loading branch information
juliusknorr committed Jun 25, 2020
1 parent 692ee8e commit 2e38da7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/Controller/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function getSettings() {
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'),
'edit_groups' => $this->appConfig->getAppValue('edit_groups'),
'use_groups' => $this->appConfig->getAppValue('use_groups'),
'doc_format' => $this->appConfig->getAppValue('doc_format'),
Expand Down
4 changes: 3 additions & 1 deletion lib/Preview/Office.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) {
$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]];

Expand Down
4 changes: 3 additions & 1 deletion lib/Service/CapabilitiesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ private function renewCapabilities() {
$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);
Expand Down
4 changes: 3 additions & 1 deletion lib/WOPI/DiscoveryManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ public function fetchFromRemote() {
$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);
Expand Down

0 comments on commit 2e38da7

Please sign in to comment.