Skip to main content
Tech Tutorials & Programming20 min readAug 21, 2026

How Do You Fix Error Code 407: Proxy Authentication Required?

Zeid Abughazaleh
Zeid Abughazaleh

Aug 21, 2026

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:

bash

--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:

bash

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.

StatusWhat it meansTypical senderChallenge headerCredential headerFirst place to check
401 UnauthorizedThe origin requires accepted authenticationDestination website or APIWWW-AuthenticateAuthorizationWebsite or API credentials
407 Proxy Authentication RequiredA proxy requires accepted authenticationHTTP proxyProxy-AuthenticateProxy-AuthorizationProxy configuration and access policy
403 ForbiddenThe server understands the request but refuses itOrigin or intermediaryNo required authentication challengeNot defined as the remedyPermissions, 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 causeWhat usually reveals itCorrect fix
Normal authentication challengeA compatible client retries automatically, and the request then succeedsNo fix is required
Missing proxy credentialsThe request contains no accepted proxy credentialsConfigure credentials in the proxy-specific fields
Wrong, rotated, or expired credentialsThe endpoint and scheme are correct, but authentication still failsCopy active credentials again or replace them
Wrong proxy host or portAnother live proxy answers, or the expected account is not recognizedUse the endpoint shown in the provider dashboard or documentation
Authentication-method mismatchProxy-Authenticate offers a method the client is not usingSelect a supported offered method
Broken credential parsingThe username or password contains reserved URL or shell charactersUse separate credential fields or encode the URL correctly
Source IP is not approvedThe access point uses IP allowlisting, and the client's public IP changedUpdate the allowlist from the actual client network
Conflicting proxy settingsThe application reaches a system, environment, or upstream proxy insteadRemove the conflict or configure the proxy that answered
Account or proxy-side failureKnown-good settings fail across controlled clientsCheck 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.

  1. Capture the response. Record the status, Proxy-Authenticate value, proxy endpoint, and provider message. Do not record the password or full Proxy-Authorization value.
  2. Confirm the route. Verify the proxy hostname, port, scheme, and any system or environment setting that can override them.
  3. Test active access. Recopy the username and password, or confirm that the actual public source IP is allowlisted.
  4. Match the method. Make sure the client supports one of the offered authentication schemes.
  5. Isolate the application. Reproduce the request with cURL from the same machine and network.
  6. Check provider policy. Confirm the account, access point, traffic allowance, and allowed gateway remain active.
  7. 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:

bash

--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.

bash
Challenge offered by the proxyRelevant cURL optionImportant limitation
Basic--proxy-basic or the default behaviorBase64 does not encrypt the credentials
Digest--proxy-digestThe client must implement Digest proxy authentication
Negotiate--proxy-negotiateBuild and operating-system support can vary
NTLM--proxy-ntlmBuild and operating-system support can vary
Several supported schemes--proxy-anyauthNegotiation 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:

bash

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:

ProblemCorrect treatmentExample
The shell interprets or splits $, !, spaces, or backticksQuote the command argument for that shell--proxy-user 'user:p@ss word' in Bash or zsh
A single quote appears inside a single-quoted valueUse the shell's quote-escaping syntax or a protected configuration fileDo not paste it unescaped between single quotes
A reserved character appears inside URL credentialsPercent-encode that credential component@ becomes %40
The application has separate auth fieldsUse those fields instead of URL user informationProxy 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:

bash

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:

bash

--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 resultWhat it establishesNext step
cURL's final HTTP result is 407The proxy answered, but the tested path did not gain accessCheck the offered method, credentials, allowlist, and account
The request succeeds through the expected exitThat exact cURL path received proxy accessCompare the application's route and auth handling
The proxy hostname cannot resolveNo HTTP 407 was reachedCorrect the hostname or resolver
The connection is refused or times outNo HTTP 407 was received from that endpointCheck the port, route, firewall, and service state
A SOCKS5 handshake failsThe client is not using HTTP proxy authenticationDebug 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.

ToolWhere to checkCommon 407 mistake
cURL--proxy, --proxy-user, and proxy-auth optionUsing --user, forcing the wrong method, or using the wrong proxy scheme
Python RequestsPer-request proxies mapping and environment variablesMissing Basic credentials, malformed URL user information, or an environment override
Git over HTTP or HTTPShttp.proxy and http.proxyAuthMethodWrong configured proxy, missing username, or an unsupported method
Postman desktop appSettings > ProxyCustom proxy overrides the system proxy, or Basic proxy auth is not configured
BrowserBrowser, extension, or operating-system proxy settingsCredentials 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 suggestionWhy it usually does not fix 407When it can still be relevant
Clear website cookies and cacheProxy authentication is separate from website cookiesIt can address a later website-session problem after proxy authentication succeeds
Change DNS serversA received 407 means an HTTP proxy already answeredDNS matters when the proxy hostname does not resolve or resolves incorrectly
Rotate the exit IPAuthentication normally happens before the proxy grants accessRotation can address a later target-side block after proxy authentication succeeds
Repeat a failed request after authenticationOnce negotiation finishes, repetition does not make rejected access validA bounded retry may help after a confirmed temporary auth-backend failure
Add --insecureCertificate verification does not satisfy proxy authenticationIt can isolate a separate certificate problem in a controlled test, but weakens security
Change the destination password407 challenges proxy access, not the destination accountA 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:

  1. Stop blind retries after the client completes any required authentication exchange and still receives 407.
  2. Record the endpoint, status, challenge scheme, and sanitized provider message.
  3. Alert the credential or network owner.
  4. Revalidate access through a controlled test.
  5. 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.

FAQ

Got questions?
We've got answers.

Quick answers to the most common questions about this topic.

HTTP 407 means a proxy requires acceptable authentication before it will handle the requested connection. The proxy sends a Proxy-Authenticate challenge, and the client can retry with Proxy-Authorization. Check the proxy endpoint, credentials, method, source IP policy, and account state rather than the destination website's login.

The HTTP proxy rejected authentication while the client was trying to create an HTTPS tunnel with CONNECT. The destination request normally has not started. Confirm the proxy credentials, inspect Proxy-Authenticate, and verify that the client supports the offered method before retrying the tunnel.

The username and password may be valid for another endpoint, access point, or authentication method. The source IP may also be missing from an allowlist. Run cURL with --verbose and confirm the proxy scheme and port. Inspect the challenge and account state without sharing credentials.

No. SOCKS5 uses its own authentication negotiation and failure status rather than HTTP 407. If a tool reports 407 while configured for SOCKS5, verify the proxy scheme and port. The tool may be treating the endpoint as an HTTP proxy or encountering another HTTP proxy upstream.

Clearing website cache and cookies does not correct missing or rejected proxy authentication. A browser restart can sometimes reset a stale authentication prompt, but the lasting fix remains the proxy configuration. Check the system proxy, browser extension, endpoint, credentials, and required authentication method.

A VPN does not create HTTP 407 by itself. It can change the client's public source IP and break an allowlist. It can also route traffic through another authenticated proxy. The HTTP proxy on that altered path still returns the 407 response.

Open the Postman desktop app's Proxy settings. Verify whether the request uses the system or custom proxy. Custom settings take priority when both are enabled. Add the correct Basic credentials where supported. If the proxy requires another method, use a compatible client or ask for a supported method.

Ready to launch?

Proxies built for real operations.

For teams that depend on stability, not luck.