Class: Koji::Plugins::SelfSignedCertificate

Inherits:
Base
  • Object
show all
Defined in:
lib/koji/plugins/self_signed_cert.rb

Instance Attribute Summary

Attributes inherited from Base

#website

Instance Method Summary collapse

Methods inherited from Base

inherited, #initialize, #name, #report

Constructor Details

This class inherits a constructor from Koji::Plugins::Base

Instance Method Details

#evidence_listObject



11
12
13
14
15
# File 'lib/koji/plugins/self_signed_cert.rb', line 11

def evidence_list
  @evidence_list ||= [].tap do |out|
    out << "The website has a self-signed certificate" if self_signed?
  end
end

#scoreObject



17
18
19
# File 'lib/koji/plugins/self_signed_cert.rb', line 17

def score
  evidence_list.empty? ? 0 : 100
end

#self_signed?Boolean

Returns:

  • (Boolean)


6
7
8
9
# File 'lib/koji/plugins/self_signed_cert.rb', line 6

def self_signed?
  website.body
  website.exception.is_a?(OpenSSL::SSL::SSLError) && website.exception.to_s.include?("self signed certificate")
end