Class: Chef::Handler::Graylog::Sender::Http::GraylogSSLPolicy

Inherits:
Chef::HTTP::DefaultSSLPolicy
  • Object
show all
Defined in:
lib/chef/handler/graylog/sender/http.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_client, config) ⇒ GraylogSSLPolicy

Returns a new instance of GraylogSSLPolicy.



15
16
17
18
# File 'lib/chef/handler/graylog/sender/http.rb', line 15

def initialize(http_client, config)
  @config = config # Needs to be set BEFORE calling super to avoid nil error in #config.
  super(http_client)
end

Class Method Details

.apply_to(http_client, config) ⇒ Object



10
11
12
13
# File 'lib/chef/handler/graylog/sender/http.rb', line 10

def self.apply_to(http_client, config)
  new(http_client, config).apply
  http_client
end

Instance Method Details

#configObject



20
21
22
23
24
25
26
27
28
# File 'lib/chef/handler/graylog/sender/http.rb', line 20

def config
  {
      :ssl_verify_mode => @config[:set_verify_mode] || :verify_peer, # available: :verify_peer, :verify_none
      :ssl_ca_path => @config[:ssl_ca_path],
      :ssl_ca_file => @config[:ssl_ca_file],
      :ssl_client_cert => @config[:ssl_client_cert],
      :ssl_client_key => @config[:ssl_client_key]
  }
end