Residential ProxiesFrom $0.65/GBResidential from $0.65/GB

Real household IPs in 120+ countries, with country, state and city targeting.

View plansView
Products
Locations
Use Cases
Solutions
Pricing
Resources
  1. Home
  2. Guides
  3. Fix 407 Proxy Authentication Required and Other Proxy Errors

Reference

Fix 407 Proxy Authentication Required and Other Proxy Errors

What 407 Proxy Authentication Required, connection refused, ERR_TUNNEL_CONNECTION_FAILED, timeouts and TLS errors mean when you use a proxy, and how to fix each one. Works for any provider.

  • Beginner
  • 9 min read
  • Updated November 2026
Fix 407 Proxy Authentication RequiredFrom this guide
BASH
# a password with special characters, encoded in the URL
curl -x "http://customer-1:p%40ss%3Aword@proxy.example.com:8080" https://example.com/
 
# or keep the URL plain and pass the login separately (no encoding needed)
curl -x http://proxy.example.com:8080 -U "customer-1:p@ss:word" https://example.com/

Overview Introduction

A proxy error tells you which step of the connection failed, even when the message is short. This guide maps the errors you see in browsers, cURL, Python and scraping tools to that step, then gives the fixes in the order that solves most cases: the 407 login error first, then refused and silent connections, protocol mix-ups, TLS errors and blocks by the website. It applies to any proxy provider; notes for Fusion Proxy are marked.

Start here Find the Step That Fails

Every request through a proxy goes through the same steps: your machine looks up the proxy host, opens a TCP connection to it, logs in and asks for a tunnel (HTTP CONNECT or SOCKS5), sets up TLS with the website through that tunnel, and finally sends the request. Each error message belongs to one of these steps, and the step tells you where to look.

Find the Step That Fails
Error you seeStep that failedMost likely cause
407 Proxy Authentication RequiredProxy loginWrong username or password, special characters not encoded, or no traffic left on the plan
curl: (56) CONNECT tunnel failed, response 407Proxy loginThe same as 407: the proxy refused the login for the tunnel
ERR_PROXY_CONNECTION_FAILED (Chrome)TCP connectWrong host or port, the proxy is offline, or a firewall blocks the port
Connection refused, curl: (7) Failed to connectTCP connectNothing listens on that port
ERR_TUNNEL_CONNECTION_FAILED (Chrome)TunnelThe proxy answered CONNECT with an error: login, a blocked site, or a failure on its side
Connection reset, Remote end closed connectionTunnelWrong protocol for the port, an IP allowlist, or an overloaded proxy
Timed outAny stepA firewall drops the packets, the wrong protocol, or a slow proxy
SSL or certificate errorsTLShttps:// used for an HTTP proxy, a wrong system clock, or TLS inspection on the network
502, 503 or 504 from the proxyRequestThe proxy could not reach the website
403, 429 or a captcha from the websiteRequestThe website blocks or rate-limits the exit IP

Most common Fix 407 Proxy Authentication Required

The proxy needs a username and password and did not accept the ones it received, or received none. Work through these causes in order:

  1. Copy the credentials again. Copy the username and password from your provider's dashboard, without spaces or line breaks around them.
  2. Encode special characters inside a proxy URL. In http://user:password@host:port the characters @ : / ? # % in the password break the URL. Write @ as %40, : as %3A, / as %2F, ? as %3F, # as %23 and % as %25. Tools that take the username and password in separate fields need no encoding.
  3. Use a URL, not an export line. Many dashboards export proxies as host:port:user:pass. That is a list format, not a proxy URL; write it as http://user:pass@host:port.
  4. Check the plan. Many providers answer 407 when the traffic or the plan has run out.
  5. Check the username options. Providers read settings such as country or session from the username. A typo in that part is a different username, and the login fails.
  6. IP allowlist instead of a login. If your IP address is on the provider's allowlist, send no credentials at all, and make sure the request really leaves from that public IP.

Browsers add one more cause: Chrome and Chromium ignore a username and password written into --proxy-server. Send them with page.authenticate() in Puppeteer or the proxy option in Playwright instead (see the Puppeteer and Playwright guides).

Bash
# a password with special characters, encoded in the URL
curl -x "http://customer-1:p%40ss%3Aword@proxy.example.com:8080" https://example.com/
 
# or keep the URL plain and pass the login separately (no encoding needed)
curl -x http://proxy.example.com:8080 -U "customer-1:p@ss:word" https://example.com/

Step 1 Connection Refused, Timeouts and Resets

These errors happen before the login, so the username and password are not the problem.

  • Connection refused: the host answered, but nothing listens on that port. Check the port against your dashboard. Providers often use different ports for HTTP and SOCKS5, and for rotating and sticky sessions.
  • Timeout while connecting: the packets are dropped. The usual reasons are a wrong IP address, a firewall on a company network that blocks ports other than 80 and 443, or a provider that only accepts IP addresses on its allowlist. Try the same proxy from another network, such as a phone hotspot, to tell a local block from a proxy problem.
  • Reset or closed during the handshake: the port speaks another protocol than the one in your URL (an HTTP port used as SOCKS5, or the other way round), the proxy drops clients that are not on its allowlist, or it is overloaded. A proxy that goes completely silent after the connection opens is almost always a protocol mismatch.

Step 2 HTTPS, SOCKS5 and Environment Variable Mix-ups

  • https:// in front of the proxy. https://proxy:port means TLS between you and the proxy itself. Almost every proxy sold as an "HTTPS proxy" is an http:// proxy that tunnels HTTPS websites, so the right URL starts with http://. The wrong one ends in an SSL error such as "wrong version number".
  • socks5 or socks5h. With socks5:// your machine looks up the website's address and sends the IP to the proxy. With socks5h:// the proxy looks it up. Use socks5h://: your DNS stays private, sites blocked by your local DNS still work, and the lookup happens in the proxy's country.
  • HTTPS_PROXY=https://... HTTPS_PROXY names the proxy used for https:// websites. Its value is usually http://user:pass@host:port.
  • Only HTTP_PROXY set. cURL, Python and Go then send https:// requests directly, without the proxy. Set HTTPS_PROXY too.
  • Uppercase and lowercase variables that differ. Tools do not agree on which one wins; cURL ignores uppercase HTTP_PROXY. Keep one pair with the same value.
  • NO_PROXY. A host listed in NO_PROXY (or a domain ending in an entry like .example.com) skips the proxy.
  • SOCKS5 in Chrome. Chromium does not support SOCKS5 proxies with a username and password; use the HTTP port in browsers.
Bash
export HTTP_PROXY="http://user:pass@proxy.example.com:8080"
export HTTPS_PROXY="http://user:pass@proxy.example.com:8080"   # http://, not https://
unset http_proxy https_proxy                                      # no conflicting lowercase copies

Free tool Let proxy-monitor doctor Find the Problem

proxy-monitor doctor is a free, open-source command-line tool (MIT license) that checks one proxy and explains the result in plain language. It checks the URL as you typed it (export lines, unencoded characters, https:// and socks5:// mix-ups), your proxy environment variables, then connects once and shows which step failed, how long each step took, and what to try. Passwords are never printed.

Download it for Windows, macOS or Linux from GitHub, or install it with Go. To test one proxy from your browser instead, use the Proxy Tester; to clean a list of open proxies, use the Proxy Checker.

Bash
go install github.com/FusionProxies/proxy-health-monitor/cmd/proxy-monitor@latest
 
# password from the environment, so it stays out of your shell history
PROXY_PASSWORD='p@ss:word' proxy-monitor doctor http://customer-1@proxy.example.com:8080
 
# Result: auth_failed: the proxy rejected the username or password (HTTP 407)
# What to try:
#   1. copy the username and password again from your provider's dashboard
#   2. percent-encode special characters in the password (@ as %40, : as %3A, # as %23)
#   ...

Step 3 When the Website Is the Problem

If the tunnel opens and the website answers with 403, 429, a captcha or a block page, the proxy works and the website does not accept its IP. Sites that fight automation, such as ticketing, travel, banking and government sites, block datacenter IP ranges most often, and some only accept IPs from their own country.

  • Open a neutral page such as https://example.com/ through the same proxy. If that works, the block is on the website's side.
  • Try another exit IP: a new session on a rotating proxy, or another proxy from your list.
  • Match the country the site expects, and use residential IPs for sites that block datacenter ranges.
  • Slow down. A 429 means too many requests from one IP in a short time.

FAQ Frequently Asked Questions

What does 407 Proxy Authentication Required mean?

The proxy server requires a login and did not accept the one it received, or received none. It comes from the proxy, not from the website.

Why does my proxy work in cURL but not in Chrome?

Chrome ignores a username and password in --proxy-server, and it does not support SOCKS5 with a login. Pass the login through your automation tool (for example page.authenticate()) or use an IP allowlist.

How do I use a password with @ or : in a proxy URL?

Percent-encode it: @ becomes %40 and : becomes %3A. Or pass the username and password separately, for example with cURL's -U option.

What is the difference between 401 and 407?

401 comes from the website and asks for the website's own login. 407 comes from the proxy and asks for the proxy login.

Why do I get ERR_TUNNEL_CONNECTION_FAILED?

Chrome asked the proxy to open a tunnel to the website and the proxy answered with an error. Check the login first, then whether the proxy allows that website and port, then whether the website is up.

Should I use socks5:// or socks5h://?

Use socks5h://. The proxy then resolves the website's name, so your DNS lookups do not leave from your own network and the site sees a lookup from the proxy's location.

Summary Conclusion

Most proxy errors come down to the login, the port or the protocol. Find the step that fails, fix that step, and test again with one request before you run your whole job.

Continue Next Steps

In practice

A proxy error shows which step failed: 407 and tunnel errors come from the proxy login or the tunnel, connection refused means the wrong host or port, SSL errors often mean a wrong scheme, and 403 or 429 usually come from the website, not the proxy. Fix the setup first for 400, 407, refused connections and SSL errors, and retry with a pause only for 429, 502, 503 and 504.

Quick answers: proxy error codes

Code or errorWhat it meansFirst fix
400 Bad RequestThe proxy or the website could not read the request: a malformed URL or header, or the wrong protocol for the portSend the same request with cURL through the proxy and then without it; if it fails without the proxy too, fix the request
403 ForbiddenUsually the website refuses the exit IP or the requestOpen https://example.com/ through the same proxy; if that works, try another exit IP, match the country the site expects, and slow down
407 Proxy Authentication RequiredThe proxy did not accept the login, or received noneCopy the username and password again, percent-encode special characters, check the traffic left on the plan
429 Too Many RequestsToo many requests from one IP in a short timeSlow down and send fewer parallel requests to that site; wait as long as a Retry-After header asks
502 Bad GatewayThe proxy could not reach the websiteRetry once after a pause; if every site fails, check the proxy itself
503 Service UnavailableFrom the proxy: it could not reach the website. From the website: it is overloaded or limiting trafficWait and retry with a growing pause; if one site keeps sending it, slow down for that site
504 Gateway TimeoutThe proxy waited too long for the websiteRetry, raise your client timeout, or pick an exit country closer to the site
Connection refusedNothing listens on that host and portCheck the port against the dashboard: HTTP and SOCKS5 use different ports
Tunnel connection failedThe proxy answered the CONNECT request with an error: login, a blocked site, or a failure on its sideCheck the login first, then whether the proxy allows that site and port, then whether the site is up
SSL errorsOften https:// written in front of an HTTP proxy, a wrong system clock, or TLS inspection on your networkWrite the proxy URL as http://host:port, check the clock, test from another network

Fusion Proxy residential uses resi.fusionproxy.net: port 12286 for HTTP, 5390 for SOCKS5, and 13000 to 15000 for one IP per port. Banking and financial websites are blocked on all products, so a tunnel to them fails by design. In Python requests, a refused login on an https:// site shows up as a ProxyError that mentions Tunnel connection failed: 407 Proxy Authentication Required.

Retry, or fix first?

Some errors pass on their own; others repeat until you change something, and retrying them only burns time and traffic.

ErrorRetry?Why
429Yes, after a pauseThe limit resets with time; honor Retry-After when the site sends it
502, 503, 504Yes, with a growing pauseThe cause is often temporary, on the way to the website
Reset or timeoutOnce or twiceA single connection can fail; repeated failures point to the port or protocol
403Once, from another exit IPIf it stays, the site refuses this traffic; respect that instead of hammering
400, 407NoThe same request or login fails again
Connection refused, SSL errorsNoThe address, port or scheme is wrong until you change it

A Python sketch of that rule with the requests library: it retries 429, 502, 503 and 504 answers, resets and timeouts with a pause, and stops at once when the proxy refuses the connection or the tunnel, or TLS fails.

import random
import time

import requests

PROXY = "http://USERNAME:PASSWORD@resi.fusionproxy.net:12286"
PROXIES = {"http": PROXY, "https": PROXY}
RETRY_STATUS = {429, 502, 503, 504}


def fetch(url, attempts=4):
    for attempt in range(attempts):
        retry_after = ""
        try:
            r = requests.get(url, proxies=PROXIES, timeout=30)
            if r.status_code not in RETRY_STATUS:
                return r  # success, or an error a retry will not fix
            retry_after = r.headers.get("Retry-After", "")
        except (requests.exceptions.ProxyError, requests.exceptions.SSLError):
            raise  # proxy refused the connection or the tunnel (407, wrong port), or TLS failed
        except (requests.exceptions.ConnectionError, requests.exceptions.Timeout):
            pass  # a reset or a timeout: worth another try
        if attempt < attempts - 1:
            time.sleep(int(retry_after) if retry_after.isdigit() else 2 ** attempt + random.random())
    raise RuntimeError(f"no usable answer from {url} after {attempts} attempts")

Who sent the error: the proxy or the website?

A 407 always comes from the proxy and a 401 always from the website, which wants its own login. For 400, 403 and 503, open a neutral page such as https://example.com/ through the same proxy: if it loads, the proxy works and the answer came from the website. To test one proxy from your browser, use the Proxy Tester; for blocks by websites, see why proxies get banned.

Questions on this topic

What does 502 Bad Gateway mean when I use a proxy?

The proxy took your request but could not get a valid answer from the website. Retry once after a pause; if every website fails the same way, the problem is on the proxy side.

Why do I get 429 Too Many Requests on a rotating proxy?

The website counts requests per IP, and clients reuse open connections, so many requests can leave from one IP even on a rotating port. Send fewer parallel requests to that site, add pauses, and wait as long as Retry-After asks.

Is a 403 Forbidden the proxy's fault?

Usually not. If a neutral page such as https://example.com/ loads through the same proxy, the 403 came from the website, which refuses that IP or that request.

Should I retry proxy errors automatically?

Only the temporary ones: 429 after a pause and 502, 503 or 504 with a growing pause. Errors such as 400, 407, connection refused and SSL errors repeat until you fix the login, the port or the scheme.

Start Using FusionProxy Today

Claim 1 GB Free Trial, cancel anytime.

Start Free Trial
  • No contracts
  • Instant setup
  • Cancel anytime

A card is required. A paid 10 GB plan starts after 7 days unless you cancel. View trial terms.