From 5effc7320ec45bb7f04593caac54b05d90e914bc Mon Sep 17 00:00:00 2001 From: Git'Fellow Date: Mon, 16 May 2022 12:28:50 +0200 Subject: [PATCH] Fix backport --- 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 38218a721e0..410c2832956 100644 --- a/lib/private/Security/CertificateManager.php +++ b/lib/private/Security/CertificateManager.php @@ -245,15 +245,19 @@ class CertificateManager implements ICertificateManager { * @return string */ public function getAbsoluteBundlePath(): string { - if (!$this->hasCertificates()) { - return \OC::$SERVERROOT . '/resources/config/ca-bundle.crt'; + if (!$this->bundlePath) { + if (!$this->hasCertificates()) { + $this->bundlePath = \OC::$SERVERROOT . '/resources/config/ca-bundle.crt'; + } + + if ($this->needsRebundling()) { + $this->createCertificateBundle(); + } + + $this->bundlePath = $this->view->getLocalFile($this->getCertificateBundle()); } - if ($this->needsRebundling()) { - $this->createCertificateBundle(); - } - - return $this->view->getLocalFile($this->getCertificateBundle()); + return $this->bundlePath; } /**