diff --git a/PVE/API2/ACME.pm b/PVE/API2/ACME.pm index 33890dac..393e6b01 100644 --- a/PVE/API2/ACME.pm +++ b/PVE/API2/ACME.pm @@ -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";