diff --git a/lib/private/Security/CertificateManager.php b/lib/private/Security/CertificateManager.php index 3a87b7f1a004e..479cb0e3abda8 100644 --- a/lib/private/Security/CertificateManager.php +++ b/lib/private/Security/CertificateManager.php @@ -241,17 +241,17 @@ public function getAbsoluteBundlePath(): string { 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;