Quick Answer
Error code 407 means an HTTP proxy requires the client to authenticate before it will handle the request. The destination website is not asking for these credentials. The proxy is.
Start by checking the proxy hostname, port, and protocol. Then confirm the username, password, authentication method, account status, and source Internet Protocol (IP) address.
RFC 9110, published in 2022, requires every proxy-generated 407 to include a Proxy-Authenticate challenge. Inspect that header before changing random settings. It shows which authentication scheme the proxy is offering.
Use cURL to test the same endpoint outside the affected application:
--disable skips cURL's default configuration file. --noproxy "" prevents NO_PROXY from bypassing the endpoint during this test. --proxy-anyauth selects a supported scheme from the proxy's challenge.
These examples use Bash or zsh syntax. Other shells quote credentials differently.
Replace every placeholder with exact provider details in a private test environment. Command-line passwords can enter shell history or briefly appear in process listings.
Keep the proxy scheme unchanged. An HTTPS destination does not turn an http:// proxy endpoint into an https:// endpoint.
Key Takeaways
- Error 407 comes from an HTTP proxy. A standards-compliant proxy uses it to challenge the client for acceptable credentials.
- The response header matters. Proxy-Authenticate identifies one or more schemes the proxy accepts.
- Proxy and website logins are separate. Proxy-Authorization goes to the proxy, while Authorization goes to the destination.
- A correct password can still fail. The client may use the wrong endpoint, scheme, source IP, or authentication method.
- Blind retries do not repair authentication. Allow the required challenge exchange, but stop repeated failures and correct the configuration.
- SOCKS5 does not use HTTP 407. SOCKS5 authentication failures occur inside the SOCKS5 handshake.
- Disabling certificate checks is not a fix. Transport Layer Security (TLS) verification and proxy authentication solve different problems.
What Does Error Code 407 Mean?
Error code 407 means an HTTP proxy requires client authentication before it will forward a request to the intended destination.
RFC 9110, published in 2022, names the status 407 Proxy Authentication Required. The specification requires a proxy-generated 407 response to include at least one Proxy-Authenticate challenge.
Proxy-Authenticate can carry multiple challenges, so capture every field value before selecting a method.
A simple response can look like this:
The client can retry with credentials in Proxy-Authorization. A browser, cURL, or an HTTP library should build that header according to the selected authentication scheme.
For an HTTPS destination reached through an HTTP proxy, the challenge often appears during the CONNECT request. cURL may report CONNECT tunnel failed, response 407 because the proxy refused to create the tunnel. In that case, the destination normally has not received the intended HTTPS request.
HTTP 407 covers missing, invalid, or incomplete proxy credentials. It does not identify the exact mistake. The response challenge, provider message, client configuration, and proxy logs supply the missing detail.
The HTTP vs SOCKS5 proxies comparison shows that each protocol uses a different authentication path. A genuine SOCKS5 authentication failure occurs during the SOCKS5 handshake, not through an HTTP 407 response.
The broader proxy error code breakdown also separates authentication failures from hostname, connection, timeout, and target errors. That distinction prevents a transport failure from being misdiagnosed as rejected credentials.
How Is Error 407 Different From 401 and 403?
Error 407 requests proxy authentication; 401 requests origin authentication, while 403 refuses access without requiring a challenge.
The headers show whether the proxy or destination rejected the credentials. RFC 9110 assigns Proxy-Authenticate and Proxy-Authorization to proxy authentication. It assigns WWW-Authenticate and Authorization to destination authentication.
| Status | What it means | Typical sender | Challenge header | Credential header | First place to check |
|---|---|---|---|---|---|
| 401 Unauthorized | The origin requires accepted authentication | Destination website or API | WWW-Authenticate | Authorization | Website or API credentials |
| 407 Proxy Authentication Required | A proxy requires accepted authentication | HTTP proxy | Proxy-Authenticate | Proxy-Authorization | Proxy configuration and access policy |
| 403 Forbidden | The server understands the request but refuses it | Origin or intermediary | No required authentication challenge | Not defined as the remedy | Permissions, policy, or target rules |
Valid credentials that lack enough permission can lead to 403 instead of 401 or 407. That distinction prevents a common mistake: repeatedly changing a website password when the proxy is the component asking for access. Check the challenge header before changing either login.
The sender should still be verified. A custom gateway can use nonstandard messages, and an application may hide the original response behind its own error text. Capture the response status and headers from the actual client path whenever possible.
What Causes Error Code 407?
Error code 407 appears when a proxy requests authentication or rejects the credentials, method, endpoint, allowlist, or account context.
The HTTP specification defines the challenge, but it does not define a provider's account rules. Some services use 407 when an access point is disabled or a source IP is not approved.
A service may also reject an account that cannot use the requested gateway. Those meanings are provider-specific.
| Likely cause | What usually reveals it | Correct fix |
|---|---|---|
| Normal authentication challenge | A compatible client retries automatically, and the request then succeeds | No fix is required |
| Missing proxy credentials | The request contains no accepted proxy credentials | Configure credentials in the proxy-specific fields |
| Wrong, rotated, or expired credentials | The endpoint and scheme are correct, but authentication still fails | Copy active credentials again or replace them |
| Wrong proxy host or port | Another live proxy answers, or the expected account is not recognized | Use the endpoint shown in the provider dashboard or documentation |
| Authentication-method mismatch | Proxy-Authenticate offers a method the client is not using | Select a supported offered method |
| Broken credential parsing | The username or password contains reserved URL or shell characters | Use separate credential fields or encode the URL correctly |
| Source IP is not approved | The access point uses IP allowlisting, and the client's public IP changed | Update the allowlist from the actual client network |
| Conflicting proxy settings | The application reaches a system, environment, or upstream proxy instead | Remove the conflict or configure the proxy that answered |
| Account or proxy-side failure | Known-good settings fail across controlled clients | Check service status and contact the provider or administrator |
A standards-compliant 407 indicates that an HTTP proxy answered the client. It does not prove that the password is the only possible problem. Failure to resolve or connect to that proxy occurs before an HTTP 407 can be received.
When these requirements recur, teams should choose the best proxy server by checking its authentication methods, endpoint types, access controls, and troubleshooting visibility.
How Should You Diagnose Error Code 407?
Error 407 diagnosis starts with the responding proxy's challenge and one controlled test using the same connection path.
The Seven-Check 407 Test is an original troubleshooting sequence for this guide. Work through it in order so each result narrows the cause.
- Capture the response. Record the status, Proxy-Authenticate value, proxy endpoint, and provider message. Do not record the password or full Proxy-Authorization value.
- Confirm the route. Verify the proxy hostname, port, scheme, and any system or environment setting that can override them.
- Test active access. Recopy the username and password, or confirm that the actual public source IP is allowlisted.
- Match the method. Make sure the client supports one of the offered authentication schemes.
- Isolate the application. Reproduce the request with cURL from the same machine and network.
- Check provider policy. Confirm the account, access point, traffic allowance, and allowed gateway remain active.
- Escalate with evidence. Send sanitized logs to the proxy provider or network administrator when the controlled test still fails.
Keep the destination constant during the test. Changing the website, proxy, credentials, and network together makes the result impossible to interpret.
Do not start by clearing website cookies or changing Domain Name System (DNS) servers. Those actions do not supply proxy credentials. They only add another variable to the investigation.
How Do You Check the Proxy Address and Credentials?
Proxy address and credential checks should compare the application against the provider-supplied endpoint, port, scheme, username, and password.
Copy each value again instead of trusting an old configuration. A proxy hostname and endpoint must match the provider's current port, protocol, and access point. Look for trailing spaces, missing characters, or a structured username that lost a location or session segment.
Preserve the password's letter case and punctuation. Avoid smart quotes copied from formatted documents.
The proxy scheme describes the first connection. Keep http:// when the provider supplies an HTTP proxy, even when the requested destination begins with https://. Change the scheme only when the proxy endpoint itself supports another protocol.
Use the proxy-specific credential setting in each client. In cURL, that setting is --proxy-user, not --user:
--user authenticates to the destination. Using it instead of --proxy-user does not configure proxy credentials and can send the wrong secret to the website.
Test copied values before retyping them manually. A password manager or dashboard copy button can reduce transcription errors during troubleshooting.
An incorrect hostname or port more commonly produces a resolution or connection error. It can still produce 407 when the typo reaches another working proxy that does not recognize the supplied account.
How Do You Match the Proxy Authentication Method?
Proxy authentication succeeds when the client uses an offered scheme and sends credentials in that scheme's required format.
The Proxy-Authenticate header can contain one or more challenges. Common HTTP proxy schemes include Basic, Digest, Negotiate, and NTLM. The proxy may also include a realm or scheme-specific parameters.
cURL uses Basic for HTTP proxy authentication by default. The official cURL manual provides separate options for Digest, Negotiate, and NTLM proxy authentication.
--proxy-anyauth asks cURL to choose a supported method offered by the proxy. That negotiation can add a request-response round trip.
| Challenge offered by the proxy | Relevant cURL option | Important limitation |
|---|---|---|
| Basic | --proxy-basic or the default behavior | Base64 does not encrypt the credentials |
| Digest | --proxy-digest | The client must implement Digest proxy authentication |
| Negotiate | --proxy-negotiate | Build and operating-system support can vary |
| NTLM | --proxy-ntlm | Build and operating-system support can vary |
| Several supported schemes | --proxy-anyauth | Negotiation can add a round trip |
Do not force Basic merely because it is familiar. If the proxy offers only another method, a Basic retry will not authenticate.
RFC 7617, published in 2015, explains that Basic uses Base64 rather than encryption. Protect Basic credentials with an encrypted client-to-proxy connection, such as an HTTPS proxy, when the service supports one. Destination HTTPS does not encrypt credentials sent over a separate plain HTTP connection to the proxy before the tunnel exists.
How Do You Fix Proxy URLs With Special Characters?
Proxy URL credentials need correct delimiter encoding, while command-line fields also need protection from shell parsing.
The inline format looks simple:
It becomes ambiguous when the username or password contains characters such as @, #, /, ?, %, or :. These characters can act as Uniform Resource Identifier (URI) or credential delimiters instead of remaining part of the secret.
Percent-encode reserved characters when credentials must appear inside a proxy URL. Do not percent-encode an entire URL as one string. Encode the username and password components separately, then assemble the URL.
Whenever the client allows it, keep the proxy address, username, and password in separate fields. cURL's --proxy-user avoids credential parsing inside the URL. The shell can still interpret unquoted characters.
Quoting and percent-encoding solve different problems:
| Problem | Correct treatment | Example |
|---|---|---|
| The shell interprets or splits $, !, spaces, or backticks | Quote the command argument for that shell | --proxy-user 'user:p@ss word' in Bash or zsh |
| A single quote appears inside a single-quoted value | Use the shell's quote-escaping syntax or a protected configuration file | Do not paste it unescaped between single quotes |
| A reserved character appears inside URL credentials | Percent-encode that credential component | @ becomes %40 |
| The application has separate auth fields | Use those fields instead of URL user information | Proxy URL plus username and password fields |
Basic authentication also uses the first colon to separate the username from the password. RFC 7617 therefore does not permit a colon in a Basic username. A password can contain a colon after that separator when the client handles it correctly.
Do not store proxy credentials in source code, histories, shared logs, or screenshots. RFC 3986 warns that secret user information can enter histories and logs.
cURL command-line secrets can briefly appear in process listings. Use protected configuration for automation.
How Do You Check IP Allowlisting and Account Status?
IP allowlisting works only when an approved public source address reaches the proxy from the client sending the request.
Check the authentication mode before assuming a username and password are required. Some proxy services separate credential access from IP allowlisting. The process for secure proxy credentials treats User/Pass and IP Whitelist as separate access-point choices.
Find the public IPv4 source from the same machine and network:
The empty --proxy value disables cURL's environment proxy for that test. api.ipify.org reports IPv4, so use another approved checker when the allowlist expects IPv6.
The result identifies the direct route's public address. It may differ when the proxy connection follows another egress gateway.
If direct internet access is blocked, ask the network administrator for the source IP.
Compare that address with the provider's allowlist. Home router reconnects and office network changes can alter the public source. Changes to a virtual private network (VPN), cloud runner, or network gateway can do the same.
Account checks matter too. Confirm that the subscription, access point, credential, traffic allowance, and requested gateway remain enabled.
A provider can attach a custom message to 407 for these conditions. HTTP does not standardize that message.
Use the provider dashboard or documentation instead of an old saved copy. Credentials from a ticket, chat, or local file may reference a deleted access point.
How Do You Find Conflicting Proxy Settings?
Conflicting proxy settings can send an application to a system, environment, browser, or upstream proxy instead of the intended endpoint.
Check every layer that can choose the route:
- Application-specific proxy configuration
- Proxy environment variables, including http_proxy, https_proxy, all_proxy, no_proxy, and application-supported uppercase variants
- Operating-system proxy settings
- Proxy auto-configuration files
- Browser extensions
- Container, continuous-integration, or runtime settings
- Corporate gateways and chained proxies
The priority differs by application. Python Requests can receive proxy settings from request code, session configuration, and environment variables. Desktop tools can combine application and operating-system settings.
Compare every active layer instead of assuming the visible setting wins. Inspect the failing process's environment when the interface appears correct but requests take another route.
The Proxy-Authenticate realm, returned headers, and connected hostname can help identify which proxy answered. A realm is only a label, so do not assume it always names the service clearly.
Proxy chains require special care. RFC 9110 limits Proxy-Authenticate to the next outbound client on the response chain. Each proxy in a chain can therefore require different credentials.
Test from the same process environment as the failing application. One terminal cannot reveal variables injected only elsewhere. Check the container, desktop application, service account, or build runner separately.
How Do You Test Error Code 407 With cURL?
cURL can isolate proxy access using the application's endpoint, network, credentials, authentication method, and destination.
First, send a controlled request with the expected credentials:
--disable skips the default cURL configuration file when it is the first option. --noproxy "" clears any bypass list for this command.
--proxy-anyauth selects a method from the proxy's challenge. The timeouts prevent a separate network problem from leaving the test open indefinitely. The response should show the public exit address used for that successful request.
A complete explanation of how to test proxies compares connectivity, forwarding, response correctness, location, and repeatability. The cURL result covers only the exact endpoint and settings tested here.
Interpret the result carefully:
| cURL result | What it establishes | Next step |
|---|---|---|
| cURL's final HTTP result is 407 | The proxy answered, but the tested path did not gain access | Check the offered method, credentials, allowlist, and account |
| The request succeeds through the expected exit | That exact cURL path received proxy access | Compare the application's route and auth handling |
| The proxy hostname cannot resolve | No HTTP 407 was reached | Correct the hostname or resolver |
| The connection is refused or times out | No HTTP 407 was received from that endpoint | Check the port, route, firewall, and service state |
| A SOCKS5 handshake fails | The client is not using HTTP proxy authentication | Debug the SOCKS5 method and credentials |
A successful cURL test does not prove that every application setting is correct. It proves only that the tested path worked.
A failed test does not prove the password alone is wrong. The endpoint, method, source IP, or provider policy may differ.
Verbose output can contain sensitive hostnames, headers, and authentication details. Redact it before sharing, and do not leave verbose traces enabled in production. A cURL with proxy command requires the same endpoint, scheme, and credential controls.
How Do You Fix Error 407 in Common Tools?
Error 407 fixes depend on where each tool stores the proxy endpoint, credentials, authentication method, and network exceptions.
| Tool | Where to check | Common 407 mistake |
|---|---|---|
| cURL | --proxy, --proxy-user, and proxy-auth option | Using --user, forcing the wrong method, or using the wrong proxy scheme |
| Python Requests | Per-request proxies mapping and environment variables | Missing Basic credentials, malformed URL user information, or an environment override |
| Git over HTTP or HTTPS | http.proxy and http.proxyAuthMethod | Wrong configured proxy, missing username, or an unsupported method |
| Postman desktop app | Settings > Proxy | Custom proxy overrides the system proxy, or Basic proxy auth is not configured |
| Browser | Browser, extension, or operating-system proxy settings | Credentials belong to another endpoint, or the browser cannot use the required method |
Python Requests can take proxy credentials through a correctly encoded proxy URL. Keep those credentials outside version-controlled files.
Git can take its endpoint from Git configuration or supported proxy environment variables. Confirm which value the failing Git process receives before changing authentication.
Postman can use custom or operating-system proxy settings. Verify the active route and use only an authentication method supported by both the proxy and client.
Use the client's proxy-authentication controls instead of adding Proxy-Authorization to ordinary destination headers. Proxy credentials belong only to the proxy and should not reach the website.
When Is Error 407 a Proxy-Side Problem?
Error 407 can be proxy-side when known-good access fails across controlled clients without a relevant configuration change.
HTTP places 407 in the 4xx client-error class. That classification does not prove the underlying fault is always on the client.
The proxy may have stale account data or an unavailable authentication backend. A broken identity provider or configuration rollout can also reject valid users.
Contact the provider or network administrator after confirming the route, challenge, credentials, method, source IP, and account state. Send enough evidence to reproduce the failure:
- Proxy hostname, port, and scheme
- Exact 407 message and sanitized response headers
- Authentication scheme offered by Proxy-Authenticate
- Client name and version
- Request time with timezone
- Public source IP when allowlisting is used
- Correlation or request identifier, if present
- Result of a controlled cURL test
Never send the password, combined proxy URL, API secret, or full Proxy-Authorization header. Rotate the credential if it appears in a ticket, public log, or screenshot.
Check whether other users on the same account or gateway see the failure. A shared failure strengthens evidence of a proxy-side problem.
Provider status and authentication status are separate. A proxy can accept connections while its account lookup fails. That situation can produce 407 instead of a connection error.
What Does Not Fix Error Code 407?
Error 407 is not fixed by changes to cookies, DNS, destination credentials, or TLS checks that leave proxy access unchanged.
| Common suggestion | Why it usually does not fix 407 | When it can still be relevant |
|---|---|---|
| Clear website cookies and cache | Proxy authentication is separate from website cookies | It can address a later website-session problem after proxy authentication succeeds |
| Change DNS servers | A received 407 means an HTTP proxy already answered | DNS matters when the proxy hostname does not resolve or resolves incorrectly |
| Rotate the exit IP | Authentication normally happens before the proxy grants access | Rotation can address a later target-side block after proxy authentication succeeds |
| Repeat a failed request after authentication | Once negotiation finishes, repetition does not make rejected access valid | A bounded retry may help after a confirmed temporary auth-backend failure |
| Add --insecure | Certificate verification does not satisfy proxy authentication | It can isolate a separate certificate problem in a controlled test, but weakens security |
| Change the destination password | 407 challenges proxy access, not the destination account | A later 401 may require separate destination credentials |
Do not disable security controls simply to make the error disappear. A different error after bypassing TLS verification does not mean the authentication problem was fixed safely.
How Can You Prevent Error Code 407?
Error 407 prevention requires scoped credentials, documented authentication, controlled proxy settings, and alerts for rejected requests.
Store proxy passwords in a secret manager or another protected configuration system. The same isolation used for web scraping with proxies applies to other automated clients. Give projects and environments separate credentials or access points.
Choose an authentication model that matches the network. Username-password authentication fits clients with changing public addresses.
IP allowlisting fits controlled systems with a stable public IP. Recheck the allowlist after network, VPN, runner, or gateway changes.
Build explicit 407 handling into automated jobs:
- Stop blind retries after the client completes any required authentication exchange and still receives 407.
- Record the endpoint, status, challenge scheme, and sanitized provider message.
- Alert the credential or network owner.
- Revalidate access through a controlled test.
- Resume the workload only after authentication succeeds.
Never log proxy passwords or authorization values. Keep Basic credentials off untrusted plain network paths. Test newly rotated credentials before removing the old credential when the provider supports a safe overlap.
Track any provider-set expiry dates for credentials. Rotate credentials through a documented process before the active values expire.
Monitor account and access-point state separately from target success. A target can be healthy while the proxy rejects every request during authentication.
What Should You Remember About Error Code 407?
- Error code 407 means an HTTP proxy requires the client to authenticate before using that proxy.
- Every proxy-generated 407 must include at least one Proxy-Authenticate challenge under RFC 9110.
- Error 401 concerns origin authentication, while error 403 is a refusal without 407's required proxy challenge.
- Correct proxy access depends on the endpoint, credentials, method, source IP, client behavior, and account policy.
- cURL provides a controlled test, but its result applies only when the application follows the same route and settings.
- SOCKS5 authentication failures use the SOCKS5 handshake rather than HTTP status 407.
- Clearing website data, changing DNS, or disabling TLS verification does not supply valid proxy credentials.