Skip to content

Commit

Permalink
log failures to read certificates during listing
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 authored and backportbot-nextcloud[bot] committed Jun 12, 2023
1 parent 0ef6996 commit 1e0e526
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/private/Security/CertificateManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,14 @@ public function listCertificates(): array {
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]);
}
}
}
Expand Down

0 comments on commit 1e0e526

Please sign in to comment.