Class: Inspec::Resources::SSL
- Inherits:
-
Object
- Object
- Inspec::Resources::SSL
- Defined in:
- lib/inspec/resources/ssl.rb
Constant Summary collapse
- VERSIONS =
[ "ssl2", "ssl3", "tls1.0", "tls1.1", "tls1.2", "tls1.3", ].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.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/inspec/resources/ssl.rb', line 46 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.
44 45 46 |
# File 'lib/inspec/resources/ssl.rb', line 44 def host @host end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
44 45 46 |
# File 'lib/inspec/resources/ssl.rb', line 44 def port @port end |
#retries ⇒ Object (readonly)
Returns the value of attribute retries.
44 45 46 |
# File 'lib/inspec/resources/ssl.rb', line 44 def retries @retries end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
44 45 46 |
# File 'lib/inspec/resources/ssl.rb', line 44 def timeout @timeout end |
Instance Method Details
#to_s ⇒ Object
85 86 87 |
# File 'lib/inspec/resources/ssl.rb', line 85 def to_s "SSL/TLS on #{@host}:#{@port}" end |