aboutsummaryrefslogtreecommitdiffstats
path: root/lacme
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2021-02-19 18:31:20 +0100
committerGuilhem Moulin <guilhem@fripost.org>2021-02-20 20:16:34 +0100
commit8de74ffb4a2008a61c05e9a24c8fa9b14858d2be (patch)
treeab87d7a1299f0c6a98dab0089b98268f652dd4c4 /lacme
parentbecac5d1fad959a0ffb0d67afed0d4d7069c3114 (diff)
Remove dependency on List::Util (core module).
Diffstat (limited to 'lacme')
-rwxr-xr-xlacme7
1 files changed, 3 insertions, 4 deletions
diff --git a/lacme b/lacme
index 9f46b47..cb399f9 100755
--- a/lacme
+++ b/lacme
@@ -30,7 +30,6 @@ use Fcntl qw/F_GETFD F_SETFD FD_CLOEXEC O_CREAT O_EXCL O_WRONLY SEEK_SET/;
use File::Basename 'dirname';
use File::Temp ();
use Getopt::Long qw/:config posix_default no_ignore_case gnu_getopt auto_version/;
-use List::Util 'first';
use POSIX ();
use Socket 1.95 qw/AF_UNIX AF_INET AF_INET6 PF_UNIX PF_INET PF_INET6 PF_UNSPEC
INADDR_ANY IN6ADDR_ANY IPPROTO_IPV6
@@ -744,15 +743,15 @@ elsif ($COMMAND eq 'newOrder' or $COMMAND eq 'new-cert') {
print STDERR " $_ = $conf->{$_}\n" foreach grep { defined $conf->{$_} } (sort keys %$conf);
}
- my $certtype = first { defined $conf->{$_} } qw/certificate certificate-chain/;
- unless (defined $certtype) {
+ my $cert = $conf->{'certificate-chain'} // $conf->{'certificate'};
+ unless (defined $cert) {
print STDERR "[$s] Warning: Missing 'certificate' and 'certificate-chain', skipping\n";
$rv = 1;
next;
}
# skip certificates that expire at least $conf->{'min-days'} days in the future
- if (-f $conf->{$certtype} and defined (my $t = x509_enddate($conf->{$certtype}))) {
+ if (-f $cert and defined (my $t = x509_enddate($cert))) {
my $d = $OPTS{'min-days'} // $conf->{'min-days'} // 21;
if ($d >= 0 and $t - time > $d*86400) {
my $d = POSIX::strftime('%Y-%m-%d %H:%M:%S UTC', gmtime($t));