lib/agent/server/am_connector.rb in site24x7_apminsight-1.8.2 vs lib/agent/server/am_connector.rb in site24x7_apminsight-1.8.3
- old
+ new
@@ -107,17 +107,17 @@
con = Net::HTTP.new(url.host, url.port)
#con.use_ssl=true
#con.verify_mode=OpenSSL::SSL::VERIFY_NONE
#@obj.log.info "connection = #{con}"
end
- con=getScheme(con)
+ con=getScheme(con, url)
con.open_timeout = @obj.constants.connection_open_timeout
con.read_timeout = @obj.constants.connection_read_timeout
con
end
- def getScheme(con)
- if(@obj.config.license_key != nil || @obj.config.is_secured)
+ def getScheme(con, url)
+ if(url.to_s.start_with?("https"))
#@obj.log.info "[connect] Secured"
#con = Net::HTTP::Proxy(@obj.config.proxy_host, @obj.config.proxy_port,@obj.config.proxy_user,@obj.config.proxy_pass).new(url.host, url.port)
con.use_ssl=true
con.verify_mode=OpenSSL::SSL::VERIFY_NONE
end