summaryrefslogtreecommitdiffstats
path: root/lib/private/http
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2016-01-12 21:47:49 +0100
committerLukas Reschke <lukas@owncloud.com>2016-01-12 21:47:49 +0100
commit28049b510b4500cd56625d5931a1c431f09253c2 (patch)
tree3d34ad56f9ecb1224ebb005d17204d4e189e40ee /lib/private/http
parenteac5d9fb3a52932fafdb200a2cf5d50fe9f1c759 (diff)
downloadnextcloud-server-28049b510b4500cd56625d5931a1c431f09253c2.tar.gz
nextcloud-server-28049b510b4500cd56625d5931a1c431f09253c2.zip
Use legacy method when ownCloud is not yet installed
The new `\OCP\ICertificateManager::getAbsoluteBundlePath` API instantiiates an ownCloud view which makes the installation fail as it queries the DB before it actually is setup. This change uses the old approach again for the case that the installation is not yet setup. The client service is required for the `.htaccess` effectivity check in the setup. In the future we could move this to a JS based one (as we have for the other setupchecks) so we can get rid of such hacks. Fixes https://github.com/owncloud/core/issues/21669 which was a regression in master caused by https://github.com/owncloud/core/issues/21336
Diffstat (limited to 'lib/private/http')
-rw-r--r--lib/private/http/client/client.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/private/http/client/client.php b/lib/private/http/client/client.php
index 8cddfc3ae03..98d7ee03b19 100644
--- a/lib/private/http/client/client.php
+++ b/lib/private/http/client/client.php
@@ -62,7 +62,14 @@ class Client implements IClient {
if ($this->certificateManager->listCertificates() !== []) {
$this->client->setDefaultOption('verify', $this->certificateManager->getAbsoluteBundlePath());
} else {
- $this->client->setDefaultOption('verify', $this->certificateManager->getAbsoluteBundlePath(null));
+ // If the instance is not yet setup we need to use the static path as
+ // $this->certificateManager->getAbsoluteBundlePath() tries to instantiiate
+ // a view
+ if($this->config->getSystemValue('installed', false)) {
+ $this->client->setDefaultOption('verify', $this->certificateManager->getAbsoluteBundlePath(null));
+ } else {
+ $this->client->setDefaultOption('verify', \OC::$SERVERROOT . '/resources/config/ca-bundle.crt');
+ }
}
$this->client->setDefaultOption('headers/User-Agent', 'ownCloud Server Crawler');