]> source.dussan.org Git - nextcloud-server.git/commitdiff
log failures to read certificates during listing 38757/head
authorRobin Appelman <robin@icewind.nl>
Thu, 25 May 2023 15:03:18 +0000 (17:03 +0200)
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>
Mon, 12 Jun 2023 12:55:51 +0000 (12:55 +0000)
Signed-off-by: Robin Appelman <robin@icewind.nl>
lib/private/Security/CertificateManager.php

index 6231534205a6cc38a170e8a7f7681c36b99af0cc..9f824f56bb2566de6d44583338ed4bbdd33fd3c0 100644 (file)
@@ -92,8 +92,14 @@ class CertificateManager implements ICertificateManager {
                while (false !== ($file = readdir($handle))) {
                        if ($file != '.' && $file != '..') {
                                try {
-                                       $result[] = new Certificate($this->view->file_get_contents($path . $file), $file);
+                                       $content = $this->view->file_get_contents($path . $file);
+                                       if ($content !== false) {
+                                               $result[] = new Certificate($content, $file);
+                                       } else {
+                                               $this->logger->error("Failed to read certificate from $path");
+                                       }
                                } catch (\Exception $e) {
+                                       $this->logger->error("Failed to read certificate from $path", ['exception' => $e]);
                                }
                        }
                }