]> source.dussan.org Git - nextcloud-server.git/commitdiff
Revert "Do not read certificate bundle from data dir by default" 24556/head
authorMorris Jobke <hey@morrisjobke.de>
Fri, 4 Dec 2020 12:37:10 +0000 (13:37 +0100)
committerMorris Jobke <hey@morrisjobke.de>
Fri, 4 Dec 2020 12:37:10 +0000 (13:37 +0100)
This reverts commit 18b0d753f2d76da10fefbf9a34e22dfdcbdc93b0.

lib/private/Http/Client/Client.php
tests/lib/Http/Client/ClientTest.php

index af4ebc52727671b96f827dab5ede4ff5346bdc48..eedd34774c58f9110661ab6116a51af9b1683a40 100644 (file)
@@ -98,18 +98,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 instantiate
                // a view
-               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';
+               if ($this->config->getSystemValue('installed', false)) {
+                       return $this->certificateManager->getAbsoluteBundlePath(null);
                }
 
-               return $this->certificateManager->getAbsoluteBundlePath();
+               return \OC::$SERVERROOT . '/resources/config/ca-bundle.crt';
        }
 
        /**
index a462a0848ae7284ac84d5569109ed4175161912e..a0c4d75c1bd8496f6114a6b3ec548842aa60e775 100644 (file)
@@ -461,8 +461,9 @@ class ClientTest extends \Test\TestCase {
                        ->with('installed', false)
                        ->willReturn(false);
                $this->certificateManager
-                       ->expects($this->never())
-                       ->method('listCertificates');
+                       ->expects($this->once())
+                       ->method('listCertificates')
+                       ->willReturn([]);
 
                $this->assertEquals([
                        'verify' => \OC::$SERVERROOT . '/resources/config/ca-bundle.crt',