+ single_response = basic_response.find_response(certificate_id)
+
+ unless single_response
+ raise "OCSP response does not have the status for the certificate"
+ end
+
+ unless single_response.check_validity
+ raise "OCSP response is not valid"
+ end
+
+ if single_response.cert_status == OpenSSL::OCSP::V_CERTSTATUS_REVOKED
+ puts "Certificate #{domains.first} on #{host} has been revoked"
+ end
+
+ subject_alt_name = certificate.extensions.find { |ext| ext.oid == "subjectAltName" }
+
+ if subject_alt_name.nil?
+ puts "Certificate #{domains.first} on #{host} has no subjectAltName"
+ else
+ alt_names = subject_alt_name.value.split(/\s*,\s*/).map { |n| n.sub(/^DNS:/, "") }
+
+ domains.each do |domain|
+ if alt_names.include?(domain)
+ alt_names.delete(domain)
+ else
+ puts "Certificate #{domains.first} on #{host} is missing subjectAltName #{domain}"