Class: SSL
- Inherits:
-
Object
- Object
- SSL
- Defined in:
- lib/inspec/resources/ssl.rb
Overview
Custom resource based on the InSpec resource DSL
Constant Summary collapse
- VERSIONS =
[ "ssl2", "ssl3", "tls1.0", "tls1.1", "tls1.2", ].freeze
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#retries ⇒ Object
readonly
Returns the value of attribute retries.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ SSL
constructor
A new instance of SSL.
- #to_s ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ SSL
Returns a new instance of SSL.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/inspec/resources/ssl.rb', line 44 def initialize(opts = {}) @host = opts[:host] if @host.nil? # Transports like SSH and WinRM will provide a hostname if inspec.backend.respond_to?("hostname") @host = inspec.backend.hostname elsif inspec.backend.class.to_s == "Train::Transports::Local::Connection" @host = "localhost" end end @port = opts[:port] || 443 @timeout = opts[:timeout] @retries = opts[:retries] end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
42 43 44 |
# File 'lib/inspec/resources/ssl.rb', line 42 def host @host end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
42 43 44 |
# File 'lib/inspec/resources/ssl.rb', line 42 def port @port end |
#retries ⇒ Object (readonly)
Returns the value of attribute retries.
42 43 44 |
# File 'lib/inspec/resources/ssl.rb', line 42 def retries @retries end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
42 43 44 |
# File 'lib/inspec/resources/ssl.rb', line 42 def timeout @timeout end |
Instance Method Details
#to_s ⇒ Object
78 79 80 |
# File 'lib/inspec/resources/ssl.rb', line 78 def to_s "SSL/TLS on #{@host}:#{@port}" end |