How to fix fatal: unable to access: Proxy CONNECT aborted in Git

GitINTERMEDIATEMEDIUMUpdated May 28, 2026· 388 views

Git's "Proxy CONNECT aborted" error means a proxy rejected the HTTP CONNECT tunnel to the remote host. Fix it by correcting proxy auth, host allow-listing, or CA trust.

Quick fix

Fixes fatal: unable to access: Proxy CONNECT aborted

# Git-specific proxy settings at each level
git config --global --get http.proxy
git config --global --get https.proxy
git config --system --get http.proxy
git config --system --get https.proxy
git config --get http.proxy   # repo-local
git config --get https.proxy  # repo-local

# Environment variables (note: lower-case and upper-case both apply)
echo "$http_proxy"  ; echo "$HTTP_PROXY"
echo "$https_proxy" ; echo "$HTTPS_PROXY"
echo "$no_proxy"    ; echo "$NO_PROXY"
  1. Check the current proxy configuration
  2. Reproduce the failure with verbose output
  3. Verify the proxy URL is reachable and correctly formatted
  4. Supply proxy authentication correctly
git — error
# Git-specific proxy settings at each level
git config --global --get http.proxy
git config --global --get https.proxy
git config --system --get http.proxy
git config --system --get https.proxy
git config --get http.proxy # repo-local
git config --get https.proxy # repo-local
# Environment variables (note: lower-case and upper-case both apply)
echo "$http_proxy" ; echo "$HTTP_PROXY"
echo "$https_proxy" ; echo "$HTTPS_PROXY"
echo "$no_proxy" ; echo "$NO_PROXY"
fatal: unable to access: Proxy CONNECT aborted

What this error means

The "fatal: unable to access: Proxy CONNECT aborted" error indicates that Git's underlying HTTP library (libcurl) tried to establish a tunnel through a proxy server using the HTTP CONNECT method, but the proxy terminated the connection before the tunnel could be established. When Git communicates with remote repositories over HTTPS, it uses libcurl to make HTTP requests. If a proxy is configured, libcurl first sends a CONNECT request asking the proxy to open a TCP tunnel to the destination (e.g. github.com:443). The proxy should reply with "HTTP 200 Connection established" and then relay all subsequent encrypted traffic. When the proxy instead aborts this exchange, you see this error. This is most common in corporate environments where a proxy is mandatory for internet access. The proxy typically aborts the CONNECT for one of a few reasons: it requires authentication that Git did not supply (HTTP 407), it is configured to block the destination host (HTTP 403), it cannot reach the upstream host (HTTP 502), or its policy forbids CONNECT tunnels to certain ports. Because the rejection is active, the failure is usually fast rather than a slow timeout.

Typical symptoms

  • Git clone, push, pull, or fetch fail immediately with 'Proxy CONNECT aborted'
  • The error message includes 'fatal: unable to access' followed by the repository URL
  • Git operations fail only when behind a corporate proxy or VPN
  • HTTPS repository URLs fail while SSH URLs may still work (if not blocked)
  • The same repository works fine from home or off the corporate network
  • The error appears right after connecting to a corporate network or enabling VPN
  • CI/CD pipelines fail at the checkout step when running behind a corporate firewall
  • The failure is fast (an active rejection), not a slow timeout

Common causes

  1. The proxy requires authentication and Git is sending no credentials, or the wrong/expired credentials (HTTP 407)
  2. The corporate proxy is configured to block the destination host (e.g. github.com, gitlab.com), returning 403 or dropping the tunnel
  3. Proxy URL or port is missing, incorrect, or pointed at the wrong listener
  4. SSL/TLS inspection by the proxy re-signs traffic with a corporate CA that Git does not trust
  5. Conflicting proxy settings between Git config and HTTP_PROXY/HTTPS_PROXY environment variables
  6. The proxy does not permit the HTTP CONNECT method for port 443 (or only allows specific ports)
  7. HTTP vs HTTPS proxy settings are mismatched (http.proxy set but https.proxy unset, or vice versa)
  8. A SOCKS proxy is configured but the bundled libcurl was built without SOCKS support
  9. A VPN is routing Git traffic through a misconfigured or unreachable proxy
  10. The proxy server itself is overloaded or temporarily failing (502/504)

How to fix "fatal: unable to access: Proxy CONNECT aborted"

1Check the current proxy configuration

First, identify exactly which proxy settings Git is using and at which level. Settings can come from Git config (system/global/local) or from environment variables, and they can conflict.

bash
# Git-specific proxy settings at each level
git config --global --get http.proxy
git config --global --get https.proxy
git config --system --get http.proxy
git config --system --get https.proxy
git config --get http.proxy   # repo-local
git config --get https.proxy  # repo-local

# Environment variables (note: lower-case and upper-case both apply)
echo "$http_proxy"  ; echo "$HTTP_PROXY"
echo "$https_proxy" ; echo "$HTTPS_PROXY"
echo "$no_proxy"    ; echo "$NO_PROXY"

Make note of everything found. If a setting exists at multiple levels, Git config takes precedence over the environment, and a repo-local value overrides global and system.

2Reproduce the failure with verbose output

Turn on verbose tracing so you can see exactly where the CONNECT exchange fails. The HTTP status code the proxy returns tells you the real cause.

bash
GIT_TRACE=1 GIT_CURL_VERBOSE=1 git ls-remote https://github.com/git/git.git

Key lines to look for:
- * Connected to <proxy> - reached the proxy host/port
- > CONNECT github.com:443 HTTP/1.1 - CONNECT request was sent
- < HTTP/1.1 200 Connection established - tunnel succeeded
- < HTTP/1.1 407 Proxy Authentication Required - missing/incorrect proxy credentials (go to step 4)
- < HTTP/1.1 403 Forbidden - the proxy is blocking the host (go to step 5)
- < HTTP/1.1 502/504 - the proxy cannot reach the destination

On Windows cmd:

bat
set GIT_TRACE=1
set GIT_CURL_VERBOSE=1
git ls-remote https://github.com/git/git.git
3Verify the proxy URL is reachable and correctly formatted

Confirm the proxy host and port are correct and that the proxy itself can open a tunnel, independent of Git.

bash
# Is the proxy port even open?
nc -zv proxy.company.com 8080

# Ask the proxy to tunnel to GitHub directly with curl
curl -v -x http://proxy.company.com:8080 https://github.com

Then set Git's proxy with the correct syntax. Use the http:// scheme even when the destination is HTTPS — the scheme describes how Git talks to the proxy, not the final destination.

bash
git config --global http.proxy  http://proxy.company.com:8080
git config --global https.proxy http://proxy.company.com:8080

If curl -x succeeds but Git still fails, the problem is in Git's config layering (step 7), not the proxy itself.

4Supply proxy authentication correctly

A 407 in step 2 means the proxy needs credentials. Prefer keeping credentials out of your Git config and shell history.

Preferred: store credentials in a protected `~/.netrc`. libcurl reads it automatically for proxy auth.

bash
# ~/.netrc  (on Windows: %USERPROFILE%\_netrc)
machine proxy.company.com
    login your_username
    password your_password

Then lock the file down so other users cannot read your credentials, and configure the proxy without embedding them:

bash
chmod 600 ~/.netrc
git config --global http.proxy  http://proxy.company.com:8080
git config --global https.proxy http://proxy.company.com:8080

Alternative (only if `.netrc` is not an option): embed credentials in the proxy URL. This writes your password in cleartext into ~/.gitconfig, so treat it as a fallback and URL-encode special characters (@=%40, :=%3A, #=%23, !=%21).

bash
git config --global http.proxy http://john.doe:p%40ssw0rd@proxy.company.com:8080

Windows NTLM/Kerberos proxies: Git's built-in client does not speak NTLM well. Run a local authenticating relay such as cntlm (or px) that holds your domain credentials, then point Git at the relay:

bash
# cntlm listens on localhost:3128 and handles NTLM upstream
git config --global http.proxy http://localhost:3128
5Allow-list or bypass the proxy for blocked hosts

If the verbose trace shows a 403 (or the tunnel is dropped) only for certain hosts, the proxy is blocking those destinations. Confirm with IT whether the host is permitted; if direct egress is available for some hosts, bypass the proxy for them.

bash
# Bypass the proxy for specific Git hosts (empty per-host proxy)
git config --global http.https://github.com.proxy ""
git config --global http.https://gitlab.com.proxy ""

# Or use NO_PROXY for a broader set of hosts
export NO_PROXY="github.com,gitlab.com,bitbucket.org,.internal.company.com"

# Conversely, route only an internal host through the proxy
git config --global http.https://internal-git.company.com.proxy http://proxy.company.com:8080

If the host is genuinely blocked by policy and not reachable directly, this is a network-policy decision for IT (step 8); there is no client-side workaround.

6Trust the corporate CA if the proxy inspects TLS

Some proxies perform TLS inspection (a man-in-the-middle): they terminate the TLS session, re-sign it with a corporate CA, and Git fails because it does not trust that CA. The correct fix is to trust the corporate CA, never to disable verification.

Obtain the corporate root CA certificate from IT (or export the chain shown in your browser at https://github.com), then point Git at it or add it to the system trust store:

bash
# Point Git at the corporate CA bundle
git config --global http.sslCAInfo /path/to/corporate-ca-bundle.crt

# Or install it system-wide (Debian/Ubuntu)
sudo cp corporate-ca.crt /usr/local/share/ca-certificates/
sudo update-ca-certificates

# RHEL/CentOS/Fedora
sudo cp corporate-ca.crt /etc/pki/ca-trust/source/anchors/
sudo update-ca-trust

Do NOT use git config --global http.sslVerify false or GIT_SSL_NO_VERIFY=1 to work around this. Disabling certificate verification removes all protection against impersonation and credential theft over the connection, and it does not actually fix the underlying trust problem. Adding the CA is both safer and permanent.

7Clear conflicting proxy settings and reconfigure cleanly

If settings exist at several levels (step 1), wipe them and set a single authoritative configuration. Mismatched http vs https proxy values, or a stale environment variable overriding your intended config, frequently cause the tunnel to be aborted.

bash
# Remove Git proxy settings at every level (ignore 'not set' errors)
git config --global --unset http.proxy
git config --global --unset https.proxy
git config --system --unset http.proxy
git config --system --unset https.proxy
git config --unset http.proxy
git config --unset https.proxy

# Clear environment variables for the current shell
unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY

On Windows PowerShell:

powershell
Remove-Item Env:HTTP_PROXY  -ErrorAction SilentlyContinue
Remove-Item Env:HTTPS_PROXY -ErrorAction SilentlyContinue

Then set both schemes to the same correct proxy:

bash
git config --global http.proxy  http://proxy.company.com:8080
git config --global https.proxy http://proxy.company.com:8080
8Try SSH if the proxy keeps blocking HTTPS

If HTTPS through the proxy is blocked by policy, SSH may take a different network path. Check whether outbound SSH is permitted first.

bash
git remote -v
git remote set-url origin git@github.com:username/repository.git
ssh -T git@github.com

If port 22 is blocked, GitHub also accepts SSH over port 443:

bash
# ~/.ssh/config
Host github.com
    HostName ssh.github.com
    Port 443
    User git

Note that many corporate networks block outbound SSH entirely; in that case correctly configured HTTPS-through-proxy (steps 4-6) is the only path.

9Escalate to IT with the diagnostic details

If authentication, allow-listing, and CA trust are all correct and the proxy still aborts the tunnel, the policy or proxy itself is at fault. Collect the evidence and raise it with your network team.

bash
# Settings in effect
git config --list | grep -i proxy
env | grep -i proxy

# Captured failure (status line shows the real cause)
GIT_CURL_VERBOSE=1 git ls-remote https://github.com/git/git.git 2>&1 | head -50

Questions for IT:
1. What is the correct proxy host, port, and authentication scheme (Basic, NTLM, Kerberos)?
2. Is GitHub/GitLab/Bitbucket on the proxy allow-list?
3. Does the proxy permit the CONNECT method to port 443?
4. Is there a PAC file or VPN profile that developer machines must use?
5. Is there a designated egress path for developer/Git traffic?

Advanced notes

### Understanding the HTTP CONNECT method

When Git accesses an HTTPS URL through a proxy, the flow is:

1. Git connects to the proxy on its configured port (e.g. 8080).
2. Git sends CONNECT github.com:443 HTTP/1.1.
3. The proxy authenticates the request (if required) and checks policy.
4. The proxy opens a TCP connection to github.com:443.
5. The proxy replies HTTP/1.1 200 Connection established.
6. The proxy then blindly relays the encrypted TLS/Git traffic in both directions.

"Proxy CONNECT aborted" means step 3, 4, or 5 failed — the proxy rejected, blocked, or could not complete the tunnel. Because TLS is established end-to-end *after* step 5, a normal (non-inspecting) proxy never sees the certificate; certificate problems only arise when the proxy performs TLS inspection.

### Proxy authentication schemes

- Basic: works directly via .netrc or credentials in the proxy URL (step 4).
- NTLM: Git's bundled curl handles NTLM poorly. Run a local relay such as cntlm (configure /etc/cntlm.conf with your domain credentials; it listens on localhost:3128) and point Git at http://localhost:3128.
- Kerberos/Negotiate: obtain a ticket with kinit user@DOMAIN.COM. This requires a curl built with GSSAPI/SPNEGO support; verify with curl --version (look for GSS-API/SPNEGO).

### SOCKS proxies

If your bundled libcurl was built with SOCKS support you can use:

bash
git config --global http.proxy socks5://proxy:1080
git config --global http.proxy socks5h://proxy:1080  # proxy does DNS resolution

Some Git for Windows builds omit SOCKS support; confirm with curl --version | grep -i socks before relying on it.

### PAC (Proxy Auto-Configuration) files

Git does not evaluate PAC files. Either read the PAC manually to find the proxy that applies to your Git host, or run a local proxy that understands PAC (for example px, installed via pip install px-proxy) and point Git at that local listener:

bash
px --pac=http://proxy.company.com/proxy.pac   # listens locally, e.g. :3128
git config --global http.proxy http://localhost:3128

### Environment variable precedence

Git resolves the proxy in this order, highest first:

1. git config http.proxy (and per-URL http.<url>.proxy)
2. https_proxy / HTTPS_PROXY for HTTPS URLs
3. http_proxy / HTTP_PROXY as a fallback
4. all_proxy / ALL_PROXY catch-all

NO_PROXY / no_proxy excludes hosts:

bash
export NO_PROXY="localhost,127.0.0.1,.internal.company.com"

### Windows credential cache

A proxy 407 that persists despite correct credentials can be caused by a stale entry cached by Git Credential Manager or the Windows Credential Manager. Remove the cached proxy credential:

bash
printf 'protocol=http\nhost=proxy.company.com\n\n' | git credential-manager erase

You can also clear it under Control Panel > Credential Manager > Windows Credentials. To inspect the OS-level WinHTTP proxy: netsh winhttp show proxy.

### CI/CD pipelines behind a proxy

Configure the proxy via environment variables so the checkout step can tunnel out. Do NOT disable TLS verification in pipelines — if the proxy inspects TLS, mount the corporate CA and trust it instead, exactly as on a workstation.

yaml
# GitHub Actions
env:
  HTTP_PROXY: http://proxy.company.com:8080
  HTTPS_PROXY: http://proxy.company.com:8080
  NO_PROXY: localhost,127.0.0.1
yaml
# GitLab CI
variables:
  HTTP_PROXY: "http://proxy.company.com:8080"
  HTTPS_PROXY: "http://proxy.company.com:8080"
  NO_PROXY: "localhost,127.0.0.1"
before_script:
  # If the proxy does TLS inspection, trust the corporate CA (do NOT set GIT_SSL_NO_VERIFY)
  - git config --global http.sslCAInfo "$CI_PROJECT_DIR/certs/corporate-ca.crt"

If a runner only fails because of a corporate CA, ship that CA into the image/runner and trust it (update-ca-certificates or http.sslCAInfo). Setting GIT_SSL_NO_VERIFY=1 disables certificate validation for every clone in the pipeline and exposes the build to man-in-the-middle attacks; it is not an acceptable standing pipeline setting.

Frequently asked questions

What does "fatal: unable to access: Proxy CONNECT aborted" mean?
The "fatal: unable to access: Proxy CONNECT aborted" error indicates that Git's underlying HTTP library (libcurl) tried to establish a tunnel through a proxy server using the HTTP CONNECT method, but the proxy terminated the connection before the tunnel could be established. When Git communicates with remote repositories over HTTPS, it uses libcurl to make HTTP requests. g.
How do I fix "fatal: unable to access: Proxy CONNECT aborted"?
Git's "Proxy CONNECT aborted" error means a proxy rejected the HTTP CONNECT tunnel to the remote host. Fix it by correcting proxy auth, host allow-listing, or CA trust.
What causes "fatal: unable to access: Proxy CONNECT aborted"?
The proxy requires authentication and Git is sending no credentials, or the wrong/expired credentials (HTTP 407) The corporate proxy is configured to block the destination host (e.g. github.com, gitlab.com), returning 403 or dropping the tunnel Proxy URL or port is missing, incorrect, or pointed at the wrong listener
Is the "fatal: unable to access: Proxy CONNECT aborted" error serious?
It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading