# File lib/chef/application.rb, line 66
  def configure_chef
    parse_options

    begin
      case config[:config_file]
      when /^(http|https):\/\//
        Chef::REST.new("", nil, nil).fetch(config[:config_file]) { |f| apply_config(f.path) }
      else
        ::File::open(config[:config_file]) { |f| apply_config(f.path) }
      end
    rescue SocketError => error
      Chef::Application.fatal!("Error getting config file #{Chef::Config[:config_file]}", 2)
    rescue Exception => error
      Chef::Log.warn("*****************************************")
      Chef::Log.warn("Can not find config file: #{config[:config_file]}, using defaults.")
      Chef::Log.warn("#{error.message}")
      Chef::Log.warn("*****************************************")

      Chef::Config.merge!(config)
    end

  end