From f6b1d50a61fa3deedee311935d17de695a3d0779 Mon Sep 17 00:00:00 2001 From: Git'Fellow Date: Mon, 16 May 2022 12:30:44 +0200 Subject: [PATCH] Fix backport --- lib/private/Security/CertificateManager.php | 23 ++++++++++++--------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/lib/private/Security/CertificateManager.php b/lib/private/Security/CertificateManager.php index 410c2832956..74ea59c3792 100644 --- a/lib/private/Security/CertificateManager.php +++ b/lib/private/Security/CertificateManager.php @@ -245,19 +245,22 @@ class CertificateManager implements ICertificateManager { * @return string */ public function getAbsoluteBundlePath(): string { - if (!$this->bundlePath) { - if (!$this->hasCertificates()) { - $this->bundlePath = \OC::$SERVERROOT . '/resources/config/ca-bundle.crt'; - } + try { + if (!$this->bundlePath) { + if (!$this->hasCertificates()) { + $this->bundlePath = \OC::$SERVERROOT . '/resources/config/ca-bundle.crt'; + } - if ($this->needsRebundling()) { - $this->createCertificateBundle(); - } + if ($this->needsRebundling()) { + $this->createCertificateBundle(); + } - $this->bundlePath = $this->view->getLocalFile($this->getCertificateBundle()); + $this->bundlePath = $this->view->getLocalFile($this->getCertificateBundle()); + } + return $this->bundlePath; + } catch (\Exception $e) { + return \OC::$SERVERROOT . '/resources/config/ca-bundle.crt'; } - - return $this->bundlePath; } /**