Lesstep
Bitbucket Cloud and Data Center · Git · Checked November 22, 2026

Bitbucket: "Received HTTP code 407 from proxy after CONNECT"

HTTP 407 is "Proxy Authentication Required": a proxy between you and Bitbucket asked for a login and Git did not send one it accepts. Bitbucket never saw the request. Find out which proxy Git is using, then either give it your proxy login (and the authentication method it wants) in Git's configuration, or remove a proxy setting that should not be there, such as one left over from another network.

What it looks like

fatal: unable to access 'https://bitbucket.org/<workspace>/<repository>.git/': Received HTTP code 407 from proxy after CONNECT

Public reports also show the shorter "The requested URL returned error: 407" and a 407 from Git LFS (see the Atlassian Community threads below). A different message, "Failed connect to host.company.com:8080; No error.", means the proxy Git is set to use cannot reach the server at all; Atlassian's article for that case is listed in the sources.

The same proxy question comes up in the IDE: Pull Request Inbox for Bitbucket, a plugin for JetBrains IDEs, uses the IDE's own HTTP Proxy settings, including the proxy login the IDE keeps, and says "The proxy asked for a login and did not accept one" when the proxy still refuses.

1. See which proxy Git uses

Git reads its proxy from its configuration and from the environment. List both:

git config --show-origin --get-regexp proxy

Windows (PowerShell):

Get-ChildItem Env: | Where-Object Name -match 'proxy'

macOS and Linux:

env | grep -i proxy

The first command prints the file each setting comes from. The Git documentation says http.proxy overrides the proxy that is normally taken from the http_proxy, https_proxy and all_proxy environment variables.

2a. The proxy is right: give Git the login

The format of http.proxy in the Git documentation is [protocol://][user[:password]@]proxyhost[:port][/path]:

git config --global http.proxy http://<user>:<password>@proxy.example.com:8080

Write characters such as @ and : in the user name or password as %40 and %3A, as in any URL. The password then sits in plain text in ~/.gitconfig (%USERPROFILE%\.gitconfig on Windows), so keep that file to yourself.

Many company proxies do not want Basic authentication. http.proxyAuthMethod sets the method; the documented values are anyauth (the default, Git picks), basic, digest, negotiate and ntlm. Ask whoever runs the proxy which one it expects, then:

git config --global http.proxyAuthMethod ntlm

To use the proxy for Bitbucket only, Git accepts the http.<url>.* form of its http options:

git config --global http.https://bitbucket.org/.proxy http://<user>:<password>@proxy.example.com:8080

2b. The proxy is not meant to be there: remove it

A proxy setting left from the office is a common reason for a 407 at home or on a VPN. Atlassian's knowledge base removes the Git settings like this:

git config --global --unset http.proxy
git config --global --unset https.proxy
git config --system --unset http.proxy
git config --system --unset https.proxy

(--system needs administrator rights on Windows and sudo on macOS and Linux.) If the proxy comes from the environment, unset it for the shell you use. PowerShell: Remove-Item Env:HTTPS_PROXY, Env:HTTP_PROXY. macOS and Linux: unset https_proxy http_proxy. A variable set in the Windows system settings has to be removed there.

3. Check

Ask Git to print what the proxy answers, in PowerShell:

$env:GIT_CURL_VERBOSE = 1
git ls-remote https://bitbucket.org/<workspace>/<repository>.git

On macOS and Linux: GIT_CURL_VERBOSE=1 git ls-remote <URL>. A line with 407 Proxy Authentication Required still comes from the proxy. When it is gone, Bitbucket's own answers appear ("Invalid username or password" if the token is wrong). If the proxy opens TLS connections and re-signs them, the next message may be about a certificate instead (trusting the company certificate).

In the IDE

Pull Request Inbox for Bitbucket, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, connects to Bitbucket with the IDE's HTTP Proxy and Server Certificates settings, not with Git's. When the proxy asks for a login and does not accept it, it reports "The proxy asked for a login and did not accept one. Check Settings | Appearance & Behavior | System Settings | HTTP Proxy." The IDE's page for that setting has Proxy authentication with login and password fields and a Check connection button. Git's own pull and push still read Git's configuration above. The review inbox, diffs and discussions are free; approving, commenting and merging are Pro, with a 30-day trial.

Get it on JetBrains Marketplace

Sources

Bitbucket and Atlassian are trademarks of Atlassian; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by Atlassian or JetBrains.

More: "PKIX path building failed" and "SSL certificate problem" · "remote: Invalid username or password" · Bitbucket Git remote URLs · 日本語