From e140907123a3975aed19caf644627dd2b953971c Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 14 Jun 2024 13:35:32 +0200 Subject: fix: don't use custom certificate bundle if no customer certificates are configured Signed-off-by: Robin Appelman --- lib/private/Security/CertificateManager.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lib/private/Security') diff --git a/lib/private/Security/CertificateManager.php b/lib/private/Security/CertificateManager.php index 4e3ec96b87b..f9fd2b160b8 100644 --- a/lib/private/Security/CertificateManager.php +++ b/lib/private/Security/CertificateManager.php @@ -204,17 +204,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; -- cgit v1.2.3