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)


14
15
16
# File 'lib/site-inspector/checks/https.rb', line 14

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

#bad_name?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/site-inspector/checks/https.rb', line 18

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

#inspectObject



22
23
24
# File 'lib/site-inspector/checks/https.rb', line 22

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

#scheme?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/site-inspector/checks/https.rb', line 6

def scheme?
  scheme == 'https'
end

#to_hObject



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

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

#valid?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/site-inspector/checks/https.rb', line 10

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