ERR_TUNNEL_CONNECTION_FAILED Error

The browser reached the proxy, but the proxy did not open an HTTPS connection to the site for it.

Updated · Prokso editorial team

Key takeaways
  • The browser reached the proxy, but the proxy refused an HTTPS tunnel to the site
  • Most often the proxy rejected the username and password, and the browser hid the 407 code
  • Copy the proxy line from the dashboard again and check the remaining traffic

What the error means

To open a site over HTTPS, the browser asks the proxy to set up a “tunnel” to the site. If the proxy refuses, the browser shows ERR_TUNNEL_CONNECTION_FAILED.

Unlike ERR_PROXY_CONNECTION_FAILED, there is a connection to the proxy. The refusal came from the proxy itself: the credentials were not accepted, the site is closed or unavailable, or there is no address for the chosen geo.

Causes

  • The proxy did not accept the username and password. The browser hides the 407 code behind a generic tunnel error.
  • The site or port is closed for the proxy. For example, mail ports and sites from the list of blocked categories.
  • The proxy could not connect to the site. The site is unavailable or rejected the connection from this address.
  • No free address for the geo parameters. The country, city and ISP are too precise.
  • The traffic has run out or the plan is paused. Then every request ends in a refusal.

How to fix it

  1. Copy the proxy line from the dashboard again and enter the credentials once more.
  2. Check the remaining traffic and the plan status.
  3. Open another site. If the error is on one site only, the cause is that site: check the blocked sites page.
  4. Simplify the geo: remove the city and ISP.
  5. Retry the request: with rotation, the next one will go through a different address.
  6. To see the exact cause, send the same request with curl using the -v flag - the response will contain the code and its name.

How to check that it works

The exact code is shown by the proxy checker or by the plan's request log in the dashboard. Then see the page for the matching error: 407, 403, 502 or 503.

Two-minute diagnosis

First paste the line into the proxy checker. If the proxy works there, the cause is in your app or its settings. If not, test the line from a terminal:

curl -v -x "http://USERNAME:PASSWORD@gw.prokso.com:823" https://api.ipify.org
  • A < HTTP/1.1 407 line right after CONNECT means the proxy answered. The name after the code, for example NO_USER, points to the cause.
  • The proxy answered CONNECT with 200 and then another code arrived - the proxy works, and that answer came from the website.
  • No answer at all, only a timeout - the connection never reached the proxy: check the host, port and network.

Setup guides where this error comes up

Proxy not working? Check it in 6 steps

FAQ

Why doesn't the browser show the real error code?

That is how browsers work: for security reasons they do not show the proxy's response to a tunnel request and replace it with a generic error.

The error only happens on HTTPS sites. Why?

A tunnel is only needed for HTTPS. Plain HTTP requests work differently, and there you will see the error code itself.

Is the error related to the site's certificate?

No. Things never got as far as checking the certificate: the connection to the site has not been established yet.

What does ERR_TUNNEL_CONNECTION_FAILED mean?

The browser connected to the proxy and asked it to open a tunnel to an https site, but the proxy refused. The browser hides the real reason - a code such as 407 or 502. You can see it with curl -v: what each code means is explained in steps 3 and 4 of the proxy check.

Why does the error appear on one site only?

If other https sites open, the login and traffic are fine. Then the gateway refused that particular site: it is closed for all customers (403 SITE_PERMANENTLY_BLOCKED), you added it to the blocked list in your plan (403 HOST_BLOCKED) or the proxy could not connect to it (502 NO_HOST_CONNECTION). In the last case a retry through another address helps.

The error is on every site. Is the proxy to blame?

Most often it is access to the plan: the username or password does not match (407 NO_USER), the traffic has run out (407 TRAFFIC_EXHAUSTED) or the plan is paused (407 USER_BLOCKED). Open the plan in your dashboard and check the balance and status. If all is fine there, test the proxy string with curl -v: the gateway writes the reason after the code. More on 407 codes on the 407 Proxy Authentication Required page.

Residential $1.59, mobile $2.50, datacenter $0.65 per GB

Sign up in a minute, get access right after payment.

Create account

Install the Prokso app