Method: Inspec::Resources::SSL#initialize

Defined in:
lib/inspec/resources/ssl.rb

#initialize(opts = {}) ⇒ SSL

Returns a new instance of SSL.



45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/inspec/resources/ssl.rb', line 45

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