Merge pull request #46069 from nextcloud/backport/45877/stable29

[stable29] fix: don't use custom certificate bundle if no customer certificates are configured
pull/46091/head
Andy Scherzinger 2024-07-10 20:33:46 +07:00 committed by GitHub
commit 650aec50bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 9 deletions

@ -228,17 +228,17 @@ class CertificateManager implements ICertificateManager {
if ($this->bundlePath === null) {
if (!$this->hasCertificates()) {
$this->bundlePath = \OC::$SERVERROOT . '/resources/config/ca-bundle.crt';
}
if ($this->needsRebundling()) {
$this->createCertificateBundle();
}
} else {
if ($this->needsRebundling()) {
$this->createCertificateBundle();
}
$certificateBundle = $this->getCertificateBundle();
$this->bundlePath = $this->view->getLocalFile($certificateBundle) ?: null;
$certificateBundle = $this->getCertificateBundle();
$this->bundlePath = $this->view->getLocalFile($certificateBundle) ?: null;
if ($this->bundlePath === null) {
throw new \RuntimeException('Unable to get certificate bundle "' . $certificateBundle . '".');
if ($this->bundlePath === null) {
throw new \RuntimeException('Unable to get certificate bundle "' . $certificateBundle . '".');
}
}
}
return $this->bundlePath;