Merge pull request #24556 from nextcloud/revert/stable20/21090

Revert "Do not read certificate bundle from data dir by default"
This commit is contained in:
Roeland Jago Douma 2020-12-04 15:09:22 +01:00 committed by GitHub
commit c7cb8eb007
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 9 deletions

View 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->config->getSystemValue('installed', false)) {
return $this->certificateManager->getAbsoluteBundlePath(null);
}
if ($this->certificateManager->listCertificates() === []) {
return \OC::$SERVERROOT . '/resources/config/ca-bundle.crt';
}
return $this->certificateManager->getAbsoluteBundlePath();
return \OC::$SERVERROOT . '/resources/config/ca-bundle.crt';
}
/**

View 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',