mirror of
https://github.com/nextcloud/server.git
synced 2026-03-28 13:23:49 -04:00
[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>
This commit is contained in:
parent
32f9b8b30e
commit
6c90e3f780
1 changed files with 2 additions and 1 deletions
|
|
@ -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';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue