X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/2ddb53561fd65d87ea3e68430290d3ac9fb17692..3c7a077610049f811e11b295e69772f69f30bdba:/cookbooks/letsencrypt/files/default/bin/check-certificate diff --git a/cookbooks/letsencrypt/files/default/bin/check-certificate b/cookbooks/letsencrypt/files/default/bin/check-certificate index 608d9e7af..303314fca 100755 --- a/cookbooks/letsencrypt/files/default/bin/check-certificate +++ b/cookbooks/letsencrypt/files/default/bin/check-certificate @@ -10,7 +10,7 @@ begin if Time.now < certificate.not_before puts "Certificate #{domain} not valid until #{certificate.not_before}" - elsif certificate.not_after - Time.now < 14 * 86400 + elsif certificate.not_after - Time.now < 21 * 86400 puts "Certificate #{domain} expires at #{certificate.not_after}" else subject_alt_name = certificate.extensions.find { |e| e.oid == "subjectAltName" } @@ -31,6 +31,6 @@ begin end connection.finish -rescue OpenSSL::SSL::SSLError => error +rescue StandardError => error puts "Error connecting to #{domain}: #{error.message}" end