api: ACME revoke: do not abort if CA is just expired

Else, a user would need to renew it first before being able to revoke
it, which does not make much sense..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-08-19 18:52:00 +02:00
parent 25beb9038c
commit 1e67b44463

View File

@ -357,7 +357,11 @@ __PACKAGE__->register_method ({
$acme->load();
print "Revoking old certificate\n";
$acme->revoke_certificate($cert);
eval { $acme->revoke_certificate($cert) };
if (my $err = $@) {
# is there a better check?
die "Revoke request to CA failed: $err" if $err !~ /"Certificate is expired"/;
}
my $code = sub {
print "Deleting certificate files\n";