Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-05-25 16:03:52 +0300
committerMorris Jobke <hey@morrisjobke.de>2020-05-25 17:57:56 +0300
commit18b0d753f2d76da10fefbf9a34e22dfdcbdc93b0 (patch)
treeb9b756711bcbef39f352cc1ef941afec2fe3f63c /lib
parentcbde1d102c06f44d9b4f84cb3d72f9fbf0a3beb5 (diff)
Do not read certificate bundle from data dir by default
Before the resources/config/ca-bundle.crt was only used when the list of custom certificates was empty and the instance was not installed. But it should also be used when the list is empty and the instance is installed. This is inverting the logic to stop if the instance is not installed to use the default bundle. And it also does this when the list is empty. Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Http/Client/Client.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/private/Http/Client/Client.php b/lib/private/Http/Client/Client.php
index af43df6365f..58234d16535 100644
--- a/lib/private/Http/Client/Client.php
+++ b/lib/private/Http/Client/Client.php
@@ -97,18 +97,18 @@ class Client implements IClient {
}
private function getCertBundle(): string {
- if ($this->certificateManager->listCertificates() !== []) {
- return $this->certificateManager->getAbsoluteBundlePath();
- }
-
// 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)) {
- return $this->certificateManager->getAbsoluteBundlePath(null);
+ if ($this->config->getSystemValue('installed', false) === false) {
+ return \OC::$SERVERROOT . '/resources/config/ca-bundle.crt';
+ }
+
+ if ($this->certificateManager->listCertificates() === []) {
+ return \OC::$SERVERROOT . '/resources/config/ca-bundle.crt';
}
- return \OC::$SERVERROOT . '/resources/config/ca-bundle.crt';
+ return $this->certificateManager->getAbsoluteBundlePath();
}
/**