Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[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 <[email protected]>
  • Loading branch information
Messj1 authored and backportbot-nextcloud[bot] committed May 4, 2023
commit 6c90e3f78067c718b2eadb01c190175c0ddd1f8c
3 changes: 2 additions & 1 deletion lib/private/Security/CertificateManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public function getCertificateBundle(): string {
*/
public function getAbsoluteBundlePath(): string {
try {
if (!$this->bundlePath) {
if ($this->bundlePath === null) {
if (!$this->hasCertificates()) {
$this->bundlePath = \OC::$SERVERROOT . '/resources/config/ca-bundle.crt';
}
Expand All @@ -251,6 +251,7 @@ public function getAbsoluteBundlePath(): string {
}
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';
}
}
Expand Down