diff options
author | Jan Messer <jan@mtec-studios.ch> | 2022-11-11 02:52:32 +0100 |
---|---|---|
committer | backportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com> | 2023-05-04 20:33:02 +0000 |
commit | 6c90e3f78067c718b2eadb01c190175c0ddd1f8c (patch) | |
tree | 327825ca58c8ddbf9bf776e2fa465eed2ffbeb97 | |
parent | 32f9b8b30eb7c8ae82f0ea006b8a64a1b2f3fdc4 (diff) | |
download | nextcloud-server-6c90e3f78067c718b2eadb01c190175c0ddd1f8c.tar.gz nextcloud-server-6c90e3f78067c718b2eadb01c190175c0ddd1f8c.zip |
[BUGFIX] check return value and improve error handling
With S3 primary storage there was a problem with getting the CA bundle from the storage without having the CA bundle for the connection which causes that the CertificateManager was throwing an Error.
This commit improves the handling in CertificateManager and log unexpected behaviors.
Signed-off-by: Jan Messer <jan@mtec-studios.ch>
-rw-r--r-- | lib/private/Security/CertificateManager.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/Security/CertificateManager.php b/lib/private/Security/CertificateManager.php index fa26c19ceae..f1107130887 100644 --- a/lib/private/Security/CertificateManager.php +++ b/lib/private/Security/CertificateManager.php @@ -238,7 +238,7 @@ class CertificateManager implements ICertificateManager { */ public function getAbsoluteBundlePath(): string { try { - if (!$this->bundlePath) { + if ($this->bundlePath === null) { if (!$this->hasCertificates()) { $this->bundlePath = \OC::$SERVERROOT . '/resources/config/ca-bundle.crt'; } @@ -251,6 +251,7 @@ class CertificateManager implements ICertificateManager { } return $this->bundlePath; } catch (\Exception $e) { + $this->logger->error('Failed to get absolute bundle path. Fallback to default ca-bundle.crt', ['exception' => $e]); return \OC::$SERVERROOT . '/resources/config/ca-bundle.crt'; } } |