Proxy troubleshooting
cURL Proxy Errors: Fix Proxy Format, Auth, 407, Timeout and SOCKS Issues
A practical cURL proxy troubleshooting guide for command line checks, APIs and scripts.
Fast diagnosis
First separate three results: curl’s exit code, the HTTP response from the destination, and the HTTP proxy’s CONNECT response. They describe different parts of the same request. An HTTP 407 means proxy authentication is required; curl error 7 means a connection failed; a displayed HTTP code 000 means curl has no response code to report.
Run the test from the same computer or server as the failing application. A web-based tester uses a different source IP and network route, which matters for IP allowlists and firewalls.
Symptoms you usually see
- You see an HTTP 407 response, HTTP code 000, or a curl error such as 5, 7 or 28.
- The proxy works in a browser but not in cURL.
- SOCKS proxy syntax fails with an HTTP-style command.
- Special characters in credentials break the proxy URL.
Match the result to the failing step
| Result | Meaning and next check |
|---|---|
| curl 5 | Proxy hostname lookup failed. Check the proxy hostname and the client’s DNS configuration. |
| curl 6 | Destination hostname lookup failed. Check its spelling and which side resolves it for your proxy type. |
| curl 7 | Connection or tunnel setup failed. Read the CONNECT result before blaming the proxy address or port. |
| curl 28 | A timeout expired. Use verbose output to identify whether connection setup or the transfer stalled. |
| curl 35 / 60 | TLS handshake / certificate verification failed. Check the named TLS peer and certificate trust. |
| curl 97 | Proxy handshake failed. Check SOCKS protocol and authentication; read the accompanying message. |
| HTTP 407 | The HTTP proxy needs valid authentication. Check proxy credentials and its advertised authentication method. |
| HTTP 000 | No HTTP response code is available. Inspect the exit code and, for a tunnel, the CONNECT result. |
See the official curl exit-code reference. The error message matters as much as the number.
Fix workflow
- Run the configuration below from the affected machine with one proxy and one simple HTTPS destination.
- Read the curl exit status together with the HTTP and CONNECT codes. Locate the first failed step in verbose output.
- Correct the matching setting: address and port, proxy authentication, source-IP allowlist, protocol or certificate trust.
- Compare a direct request to the same destination. Keep its URL unchanged while isolating the proxy route.
- Move the working settings into your application and repeat the same request before restoring normal traffic.
Authentication and TLS checks
--proxy-user supplies proxy credentials; --user supplies destination-server credentials. They are separate. For an IP-authenticated proxy, confirm the affected machine’s current public IP is allowed. A working test from another machine does not establish that.
The proxy scheme describes the connection to the proxy. An http:// proxy can carry an HTTPS destination through CONNECT; changing it to https:// requires a proxy endpoint that actually supports TLS. For certificate errors, correct the trust store, hostname or certificate chain. Avoid making --insecure or --proxy-insecure the permanent workaround.
Before sharing a diagnostic log, remove passwords, authorization headers, cookies and sensitive URL parameters. Keep the timestamp, curl version, sanitized proxy host/port, target hostname and error message.
Useful checks
The official everything curl guide has a dedicated proxy section: everything curl proxies.
Run a reproducible proxy test
Create a plain-text file named proxy-check.conf. Replace PROXY_HOST and PORT with your supplied HTTP proxy endpoint. The example destination is public; use a small URL you control when testing your own service.
proxy = "http://PROXY_HOST:PORT"
noproxy = ""
connect-timeout = 5
max-time = 20
verbose
output = "proxy-check-body.txt"
write-out = "\nhttp=%{http_code} connect=%{http_connect}\n"
url = "https://example.com/"
For username/password authentication, add this line using your own credentials. Keep the file private and out of source control. The colon separates username from password; in quoted config values, escape a literal double quote or backslash with a backslash.
proxy-user = "PROXY_USER:PROXY_PASSWORD"
Run from the directory containing the file. On Linux or macOS:
curl --disable --config proxy-check.conf
printf 'exit=%s\n' "$?"
In Windows PowerShell, invoke the executable explicitly:
curl.exe --disable --config proxy-check.conf
$LASTEXITCODE
--disable is first so curl ignores its default config. The empty noproxy value prevents an inherited bypass list from silently skipping this proxy. Received body data is written to proxy-check-body.txt. An early failure can leave an older file unchanged; a later failure can leave partial data. Check this run’s exit status and response codes. Clear or rename the test file before repeating if you need to inspect its body.
Read HTTP, CONNECT and exit status together
http=200 connect=200 with exit 0 means this HTTP-proxy tunnel and request succeeded. It does not prove every destination will accept the proxy. For an HTTPS request refused by an HTTP proxy, you may see http=000 connect=407: the tunnel was rejected before a destination response arrived. For a SOCKS request, connect=000 is expected because there is no HTTP CONNECT exchange.
The test intentionally omits --fail, so a received HTTP 4xx/5xx response is not by itself a nonzero curl exit status. Check the reported HTTP code too. The write-out guide explains curl’s result fields.
Compare the direct route
Rerun with --noproxy "*" after the config argument to bypass the proxy for this test. Use curl.exe in PowerShell.
curl --disable --config proxy-check.conf --noproxy "*"
If direct access works but the proxy route fails, investigate the proxy connection and its destination access. If both fail, inspect the target, local network and TLS details before changing providers. Check the exit status immediately after each run.
Test SOCKS5 with the correct DNS mode
For a SOCKS5 endpoint, change only the config’s proxy value to socks5h://PROXY_HOST:PORT, using the supplied SOCKS port. With socks5h://, the proxy resolves the destination hostname; with socks5://, curl resolves it locally. This distinction can explain why one mode fails. Neither setting guarantees that a destination will permit access. See the official SOCKS proxy guide.
Option details and config escaping are documented in the curl manual; proxy and server credentials are distinguished in the proxy authentication guide.
FAQ
What does cURL 407 mean?
407 is an HTTP response from a proxy requiring authentication, not a curl exit code. Check proxy credentials and the authentication method. For an HTTPS tunnel, the 407 may appear in the CONNECT result while the destination HTTP code remains 000.
Why does cURL show HTTP code 000?
curl has no HTTP response code to report. Read the exit status and verbose message to locate DNS, connection, TLS or proxy-handshake failure. HTTP 000 alone does not identify the cause.
Should I debug in code first?
Reproduce the request with curl on the same machine first. Once that succeeds, copy the endpoint, protocol, authentication and timeouts into the application and compare its result.
Order clarity
What you receive
- What you receive
Proxy connection details for the package processed through the live order form.
- Protocols
HTTP or SOCKS5 options are shown during configuration for supported packages.
- Authentication
Set the requested proxy credentials during configuration before checkout.
- Locations
Current location availability is shown in the selector and can change with inventory.
- Support and checking
Support can help verify connection details and review replacement requests under the service policy.
