githubvisual-studio-code

fatal: unable to access 'https://github.com/xxx/xxx.git/': CONNECT tunnel failed, response 421


i tried to clone my github reporsitory into my vs code, but i always got this error. Can anyone help me to fix this?


Solution

  • Your git instance has been configured to use a proxy and that proxy is failing.

    Try unsetting the environment variables, for example on Linux:

    export http_proxy=
    export https_proxy=
    export HTTP_PROXY=
    export HTTPS_PROXY=
    

    Check your git config files for a proxy. Unset them with these commands:

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

    Check the vscode interface for these options (environment variables and proxy settings). Try changing the proxy options from system to none.