# File lib/chef-config/config.rb, line 1024
    def self.proxy_uri(scheme, host, port)
      proxy_env_var = ENV["#{scheme}_proxy"].to_s.strip

      # Check if the proxy string contains a scheme. If not, add the url's scheme to the
      # proxy before parsing. The regex /^.*:\/\// matches, for example, http://. Reusing proxy
      # here since we are really just trying to get the string built correctly.
      proxy = if !proxy_env_var.empty?
                if proxy_env_var =~ /^.*:\/\//
                  URI.parse(proxy_env_var)
                else
                  URI.parse("#{scheme}://#{proxy_env_var}")
                end
              end

      return proxy unless fuzzy_hostname_match_any?(host, ENV["no_proxy"])
    end