From a13ae6b64f52c15d8509c84510bf7c9ee09fb69c Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 14 Mar 2022 18:34:09 +0100 Subject: [PATCH] return default bundle when there is an error getting the bundle Signed-off-by: Robin Appelman --- lib/private/Security/CertificateManager.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/private/Security/CertificateManager.php b/lib/private/Security/CertificateManager.php index 0c6791163c2..6f3b01e23b9 100644 --- a/lib/private/Security/CertificateManager.php +++ b/lib/private/Security/CertificateManager.php @@ -240,15 +240,19 @@ class CertificateManager implements ICertificateManager { * @return string */ public function getAbsoluteBundlePath(): string { - if (!$this->hasCertificates()) { + try { + if (!$this->hasCertificates()) { + return \OC::$SERVERROOT . '/resources/config/ca-bundle.crt'; + } + + if ($this->needsRebundling()) { + $this->createCertificateBundle(); + } + + return $this->view->getLocalFile($this->getCertificateBundle()); + } catch (\Exception $e) { return \OC::$SERVERROOT . '/resources/config/ca-bundle.crt'; } - - if ($this->needsRebundling()) { - $this->createCertificateBundle(); - } - - return $this->view->getLocalFile($this->getCertificateBundle()); } /**