Merge pull request #45877 from nextcloud/fix-default-cert-bundle-path

fix: don't use custom certificate bundle if no customer certificates are configured
This commit is contained in:
Robin Appelman 2024-06-24 11:28:19 +02:00 committed by GitHub
commit 2cf8ed905d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -204,17 +204,17 @@ class CertificateManager implements ICertificateManager {
if ($this->bundlePath === null) {
if (!$this->hasCertificates()) {
$this->bundlePath = \OC::$SERVERROOT . '/resources/config/ca-bundle.crt';
}
} else {
if ($this->needsRebundling()) {
$this->createCertificateBundle();
}
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;