mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 00:17:03 +03:00
Force reload of S/MIME certificates list on import
This commit is contained in:
parent
847d33abc6
commit
0f7505baba
1 changed files with 3 additions and 3 deletions
|
|
@ -40,12 +40,12 @@ class OpenSSL
|
||||||
$key = \str_replace(':', '', $data['extensions']['subjectKeyIdentifier'] ?? $data['hash']);
|
$key = \str_replace(':', '', $data['extensions']['subjectKeyIdentifier'] ?? $data['hash']);
|
||||||
$filename = "{$this->homedir}/{$key}.crt";
|
$filename = "{$this->homedir}/{$key}.crt";
|
||||||
if (\file_exists($filename)) {
|
if (\file_exists($filename)) {
|
||||||
\SnappyMail\Log::debug('OpenSSL', 'certificate already imported');
|
\SnappyMail\Log::debug('OpenSSL', "certificate {$key} already imported");
|
||||||
} else {
|
} else {
|
||||||
\SnappyMail\Log::debug('OpenSSL', 'certificate imported');
|
|
||||||
\file_put_contents("{$this->homedir}/{$key}.crt", $certificate);
|
\file_put_contents("{$this->homedir}/{$key}.crt", $certificate);
|
||||||
// \unlink("{$this->homedir}/certificates.json");
|
// \unlink("{$this->homedir}/certificates.json");
|
||||||
$this->certificates(true);
|
$this->certificates(true);
|
||||||
|
\SnappyMail\Log::debug('OpenSSL', "certificate {$key} imported");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -53,7 +53,7 @@ class OpenSSL
|
||||||
public function certificates(bool $force = false) : array
|
public function certificates(bool $force = false) : array
|
||||||
{
|
{
|
||||||
$cacheFile = "{$this->homedir}/certificates.json";
|
$cacheFile = "{$this->homedir}/certificates.json";
|
||||||
$result = \file_exists($cacheFile)
|
$result = (!$force && \file_exists($cacheFile))
|
||||||
? \json_decode(\file_get_contents($cacheFile), true)
|
? \json_decode(\file_get_contents($cacheFile), true)
|
||||||
: null;
|
: null;
|
||||||
if (!\is_array($result)) {
|
if (!\is_array($result)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue