aboutsummaryrefslogtreecommitdiffstats
path: root/lacme
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2021-02-14 22:59:11 +0100
committerGuilhem Moulin <guilhem@fripost.org>2021-02-15 01:31:27 +0100
commit2c1a396728a381685923f7b1c4dea53d225112fc (patch)
tree2de0abe91788ea9c795e91eba38e69069412bfb1 /lacme
parent956764d11c9445c835f992a782d90d8de90fe565 (diff)
Add (self-signed) ISRG Roots to the CA bundle.
This allows us to fully validate provided X.509 chains using that self-contained bundle, regardless of which CAs is marqued as trusted under /etc/ssl/certs. Also, remove cross-signed intermediate CAs from the bundle as they're useless in a self-contained bundle. Also, remove decomissioned intermediate CAs Authority X3 and X4 from the bundle. This change bumps the minimum OpenSSL version to 1.1.0 (for verify(1ssl)'s ‘-trusted’ and ‘-show_chain’ options).
Diffstat (limited to 'lacme')
-rwxr-xr-xlacme18
1 files changed, 11 insertions, 7 deletions
diff --git a/lacme b/lacme
index 7ad7aa8..480778f 100755
--- a/lacme
+++ b/lacme
@@ -784,13 +784,17 @@ elsif ($COMMAND eq 'newOrder' or $COMMAND eq 'new-cert') {
next;
};
- # verify certificate validity against the CA
- $conf->{CAfile} //= '@@datadir@@/lacme/ca-certificates.crt';
- if ($conf->{CAfile} ne '' and spawn({in => $x509}, 'openssl', 'verify', '-CAfile', $conf->{CAfile},
- qw/-purpose sslserver -x509_strict/)) {
- print STDERR "[$s] Error: Received invalid X.509 certificate from ACME server!\n";
- $rv = 1;
- next;
+ # verify certificate validity against the CA bundle
+ if ((my $CAfile = $conf->{CAfile} // '@@datadir@@/lacme/ca-certificates.crt') ne '') {
+ my %args = (in => $x509);
+ $args{out} = \*STDERR if $OPTS{debug};
+ my @options = ('-trusted', $CAfile, '-purpose', 'sslserver', '-x509_strict');
+ push @options, '-show_chain' if $OPTS{debug};
+ if (spawn(\%args, 'openssl', 'verify', @options)) {
+ print STDERR "[$s] Error: Received invalid X.509 certificate from ACME server!\n";
+ $rv = 1;
+ next;
+ }
}
# install certificate