     case do_download_file!(url, filename) do
       :ok -> :ok
       _ -> do_download_file!(url, filename, retries - 1)
+    end
+  end
+
+  defp download_options do
+    options = [ssl_options: [cacertfile: priv_path("cacert.pem"), ciphers: ciphers()]]
+
+    case check_proxy() do
+      nil ->
+        options
+
+      {var, url} ->
+        Mix.shell().info("- using proxy from #{var} (#{url})")
+        options ++ [proxy: url]
     end
   end
 

    if System.find_executable("gmake"), do: "gmake", else: "make"
  end

  def root? do
    uid() == 0
  end

  defp do_download_file!(url, filename, retries \\ 0)

  defp do_download_file!(url, filename, 0) do
    case :hackney.request(:get, url, [], "", download_options()) do
      {:ok, 200, _, reference} ->
        case :hackney.body(reference) do
          {:ok, body} -> File.write(filename, body)
