Module: Misty::HTTP::NetHTTP

Included in:
Auth, Client
Defined in:
lib/misty/http/net_http.rb

Class Method Summary collapse

Class Method Details

.net_http(endpoint, ssl_verify_mode, log) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/misty/http/net_http.rb', line 4

def self.net_http(endpoint, ssl_verify_mode, log)
  http = Net::HTTP.new(endpoint.host, endpoint.port)
  http.set_debug_output(log) if log.level == Logger::DEBUG
  if endpoint.scheme == "https"
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE unless ssl_verify_mode
  end
  http
end