Class: SiteInspector::Endpoint::Https

Inherits:
Check
  • Object
show all
Defined in:
lib/site-inspector/checks/https.rb

Instance Attribute Summary

Attributes inherited from Check

#endpoint

Instance Method Summary collapse

Methods inherited from Check

enabled=, enabled?, #host, #initialize, #name, name, #request, #response

Constructor Details

This class inherits a constructor from SiteInspector::Endpoint::Check

Instance Method Details

#bad_chain?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/site-inspector/checks/https.rb', line 12

def bad_chain?
  scheme? && response && response.return_code == :ssl_cacert
end

#bad_name?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/site-inspector/checks/https.rb', line 16

def bad_name?
  scheme? && response && response.return_code == :peer_failed_verification
end

#inspectObject



20
21
22
# File 'lib/site-inspector/checks/https.rb', line 20

def inspect
  "#<SiteInspector::Endpoint::Https valid=#{valid?}>"
end

#scheme?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/site-inspector/checks/https.rb', line 4

def scheme?
  scheme == 'https'
end

#to_hObject



24
25
26
27
28
29
# File 'lib/site-inspector/checks/https.rb', line 24

def to_h
  {
    valid:       valid?,
    return_code: response.return_code
  }
end

#valid?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/site-inspector/checks/https.rb', line 8

def valid?
  scheme? && response && response.return_code == :ok
end