Fix S/MIME certificates cache handling

This commit is contained in:
the-djmaze 2024-02-20 11:46:34 +01:00
parent 4b8a295fbe
commit 196dffa8d8

View file

@ -27,12 +27,12 @@ class OpenSSL
public function certificates() : array public function certificates() : array
{ {
$keys = [];
$cacheFile = "{$this->homedir}/certificates.json"; $cacheFile = "{$this->homedir}/certificates.json";
if (\file_exists($cacheFile)) { $result = \file_exists($cacheFile)
$keys = \json_decode(\file_get_contents($cacheFile), true); ? \json_decode(\file_get_contents($cacheFile), true)
} else { : null;
if (!\is_array($result)) {
$keys = [];
foreach (\glob("{$this->homedir}/*.key") as $file) { foreach (\glob("{$this->homedir}/*.key") as $file) {
$data = \file_get_contents($file); $data = \file_get_contents($file);
// Can't check ENCRYPTED PRIVATE KEY // Can't check ENCRYPTED PRIVATE KEY