]> git.openstreetmap.org Git - chef.git/commitdiff
letsencrypt: Add ECDSA key type check to check-certificate
authorGrant Slater <github@firefishy.com>
Sat, 1 Mar 2025 18:37:18 +0000 (18:37 +0000)
committerGrant Slater <github@firefishy.com>
Sat, 1 Mar 2025 19:08:52 +0000 (19:08 +0000)
cookbooks/letsencrypt/templates/default/check-certificate.erb

index 8863e9ae8f32382b01e9fc2a956656eea35feccf..319072b6b0ae8b8903d803600ea3e64890ebaf3e 100644 (file)
@@ -33,6 +33,10 @@ if ssl
     puts "Certificate #{domains.first} on #{host} expires at #{certificate.not_after}"
   end
 
+  unless certificate.public_key.is_a?(OpenSSL::PKey::EC)
+    puts "Certificate #{domains.first} on #{host} does not use ECDSA key type"
+  end
+
   digest = OpenSSL::Digest::SHA1.new
   certificate_id = OpenSSL::OCSP::CertificateId.new(certificate, issuer, digest)
   ocsp_request = OpenSSL::OCSP::Request.new.add_certid(certificate_id)