ENV["https_proxy"] || ENV["HTTPS_PROXY"] || ""
is duplicated code (line 26)

Keep your code DRY.