]> source.dussan.org Git - nextcloud-server.git/commitdiff
log failures to read certificates during listing 38468/head
authorRobin Appelman <robin@icewind.nl>
Thu, 25 May 2023 15:03:18 +0000 (17:03 +0200)
committerRobin Appelman <robin@icewind.nl>
Wed, 31 May 2023 12:40:45 +0000 (14:40 +0200)
Signed-off-by: Robin Appelman <robin@icewind.nl>
lib/private/Security/CertificateManager.php

index b9fbdcc9f02d847e5f30b5eb9cae879d76629c8c..3a87b7f1a004edd8f6070bd51c48cd839ef29a62 100644 (file)
@@ -83,8 +83,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]);
                                }
                        }
                }