lib/zabbixapi/client.rb in zabbixapi-2.2.0 vs lib/zabbixapi/client.rb in zabbixapi-2.2.1

- old
+ new

@@ -54,16 +54,16 @@ puts "[DEBUG] Timeout for request set to #{timeout} seconds" if @options[:debug] unless @proxy_uri.nil? http = Net::HTTP.Proxy(@proxy_host, @proxy_port, @proxy_user, @proxy_pass).new(uri.host, uri.port) - if uri.port == 443 + if uri.scheme == 'https' http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE end else http = Net::HTTP.new(uri.host, uri.port) - if uri.port == 443 + if uri.scheme == 'https' http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE end end http.read_timeout = timeout