I have a problem while connecting to github from my PC, using git. System Win 7.
I have connection through proxy, so i specified it in git config files (both in general git folder, and in git repo folder). To do this i entered next line to my git bush:
$ git config --global http.proxy http://<username>:<userpsw>@<proxy>:<port>
The way it works on other programms (ex: maven) it looks like that:
<username> - my login to our corp system
<userpsw> -my password to corporat system
<proxy> - 10.65.64.77
<port> - 3128
But when i try to push or to clone my repo, i receive
fatal: unable to access '<repo githup link>' Received HTTP code 407 from proxy after CONNECT
I try already to enter not just my username but domain\username, changed my password in case there are problems with code language tables. And i even entered wrong password. Error stayed the same.
When i entered in '10.65.64.177.com' and tried to push repo, i received:
fatal: unable to access '<repo github link>': Failed connect to github.com:3128; No error
Just don't know what to try.
What worked for me is something similar to what rohitmohta is proposing ; in regular DOS command prompt (not on git bash) :
first
git config --global http.proxy http://username:password@proxiURL:proxiPort
and in some cases also
git config --global https.proxy http://username:password@proxiURL:proxiPort
then
git config --global http.sslVerify false
(I confirm it's necessary : if set to true getting "SSL certificate problem: unable to get local issuer certificate" error)
in my case, no need of defining all_proxy variable
and finally
git clone https://github.com/someUser/someRepo.git
The following command is needed to force git to send the credentials and authentication method to the proxy:
git config --global http.proxyAuthMethod 'basic'
Source: https://git-scm.com/docs/git-config#git-config-httpproxyAuthMethod
Maybe you are already using the system proxy setting - in this case unset all git proxies will work:
git config --global --unset http.proxy
git config --global --unset https.proxy
I had to setup all 4 things in .gitconfig
with:
git config --global http.sslVerify false
git config --global https.sslVerify false
git config --global http.proxy http://user:pass@yourproxy:port
git config --global https.proxy http://user:pass@yourproxy:port
Only then the cloning was successful.
I had faced similar issue, behind corporate firewall. Did the following, and able to clone repository using git shell from my system running Windows 7 SP1.
Set 'all_proxy' environment variable for your user. Required by curl. export all_proxy=http://DOMAIN\proxyuser:proxypwd@proxy.server.com:8080 Set 'https_proxy' environment variable for your user. Required by curl. export https_proxy=http://DOMAIN\proxyuser:proxypwd@proxy.server.com:8080 I am not sure if this has any impact. But I did this and it worked: git config --global http.sslverify false Use https:// for cloning git clone https://github.com/project/project.git
Note-1: Do not use http://. Using that can give the below error. It can be resolved by using https://.
error: RPC failed; result=56, HTTP code = 301
Note-2: Avoid having @ in your password. Can use $ though.
@
in the password.
"
around login:password
. But I actually tried and git ignored the quotes, so the @
in the password mess it up. If someone has a workaround, I think it's worth mentionning it.
I had the same problem in a Windows environment.
I just resolved with NTLM-APS (a Windows NT authentication proxy server)
Configure your NTML proxy and set Git to it:
git config --global http.proxy http://<username>:<userpsw>@localhost:<port>
Had the 407 error from Android Studio. Tried adding the proxy, but nothing happened. Found out that it was related to company certificate, so I exported the one from my browser and added it to Git.
Export From Web Browser
Internet Options > Content > Certificates > Export (Follow wizard, I chose format "Base 64 encoded X.509(.CER))
In Git Bash
git config --global http.sslCAInfo c:\Utilities\Certificates\my_certificate
The following page was useful https://blogs.msdn.microsoft.com/phkelley/2014/01/20/adding-a-corporate-or-self-signed-certificate-authority-to-git-exes-store/
To add the proxy, like the other threads I used
git config --global http.proxy proxy.company.net:8080
git config --global https.proxy proxy.company.net:8080
"C:\Program Files\Git\mingw64\ssl\certs\ca-bundle.crt"
but instead add your company's certificate to it (maybe in a separate file as described in the link).
I was facing the same issue, so firstly i checked my npm file what i have set, i checked it with this command:-
npm config get proxy
and i find out i have set wrong proxy and i set my desire proxy as follow:
npm config set proxy http://xxx.xxx.xxx.4:8080
npm config set https-proxy http://xxx.xxx.xxx.4:8080
After that it works to me
I had same problem in my organization.
After many attempts, I came to the following solution:
I applied to the system administrator to change the proxy authentication type from Kerberos to NTLM. I'm not sure if it was mandatory (I'm an ignoramus in this matter), but my application was approved. After that I add Git setting git config --global http.proxyauthmethod ntlm
Only after that I was able to clone my repository
I had the same problem too, and tried to solve it by setting explicitly the http.proxyAuthMethod to basic.
After running a pcap trace between my server and the proxy, i noticed that the " HTTP CONNECT" request sent to the proxy during a git clone still not have a "Proxy-Authorization" header set to basic. This was due to my git version "1.8.3.1" that do not support http.proxyAuthMethod.
After installing a newest git version (2.16.6), using rpm packages foud here "https://repo.ius.io/7/x86_64/packages/g/", setting http.proxyAuthMethod to basic had finally an effect on git behavior and then my git clone was successful.
I hope this helps
FYI for everyone's information
This would have been an appropriate solution to resolve the following error
Received HTTP code 407 from proxy after CONNECT
So the following commands should be necessary
git config --global http.proxyAuthMethod 'basic'
git config --global https.proxy http://user:pass@proxyserver:port
Which would generate the following config
$ cat ~/.gitconfig
[http]
proxy = http://user:pass@proxyserver:port
proxyAuthMethod = basic
http.proxyAuthMethod
value? How can I find out what's my system's?
I think you should focus your efforts after you get to this point:
fatal: unable to access '<repo githup link>' Received HTTP code 407 from proxy after CONNECT
This means that you have not properly authenticated with the proxy. Can you double check the password you provide in this step is correct?
git config --global http.proxy http://<username>:<userpsw>@<proxy>:<port>
Your password seems to be incorrect. Recheck your credentials.
I had the similar issue and I resolved with below steps:
** Add proxy details in git**
git config --global http.sslVerify false
git config --global https.sslVerify false
git config --global http.proxy http://user:pass@yourproxy:port
git config --global https.proxy http://user:pass@yourproxy:port
This config works in my setup:
[http]
proxy = <your proxy>
[https] proxy = <your proxy>
[http]
sslVerify = false
[https]
sslVerify = false
[credential]
helper = wincred
Removing "@" from password worked for me and in anyways never keep @ in your password it will give you issue with maven and further installation
This issue occured a few days ago with my Bitbucket repositories. I was able to fix it by setting the remote url to http rather than https.
I also tried setting https proxies in the command line and git config but this didn't work.
$ git pull
fatal: unable to access 'https://username@bitbucket.org/sacgf/x.git/': Received HTTP code 407 from proxy after CONNECT
Note that we are using https:
$ git remote -v
origin https://username@bitbucket.org/sacgf/x.git (fetch)
origin https://username@bitbucket.org/sacgf/x.git (push)
Replace https url with http url:
$ git remote set-url origin http://username@bitbucket.org/sacgf/x.git
$ git pull
Username for 'https://bitbucket.org': username
Password for 'https://username@bitbucket.org':
remote: Counting objects: 43, done.
remote: Compressing objects: 100% (42/42), done.
remote: Total 43 (delta 31), reused 0 (delta 0)
Unpacking objects: 100% (43/43), done.
From http://bitbucket.org/sacgf/x
a41eb87..ead1a92 master -> origin/master
First, rewinding head to replay your work on top of it...
Fast-forwarded master to ead1a920caf60dd11e4d1a021157d3b9854a9374.
d
I experienced this error due to my corporate network using one proxy while on premise, and a second (completely different) proxy when VPN'd from the outside. I was originally configured for the on-premise proxy, received the error, and then had to update my config to use the alternate, off-prem, proxy when working elsewhere.
Have the same problem while using sourcetree Reason was Maybe switching the System Proxy from on to off while sourcetree was open. For some reason this was written into the config file of a project. This can be easily deleted over sourcetree by "Settings" -> "Edit configuration file". Just delete it out there under http
I encountered the same issue when using Git Bash. When I did the same thing in Command Prompt it worked perfectly.
I tried all of the solutions but none of them worked. Then I saw my .gitconfig file. It had multiple repeated entries and some of them were not correct(As I had tried multiple solutions). Finally I removed all the redundant and non needed settings and just kept the four settings mentioned by Sairam Kukadala, in his answer above, and Voila! it worked.
I saw this error when working on a corporate machine on Windows 10 that was not using a proxy.
From the Start menu, I had to open Settings > Network & Internet > Proxy and disable "Automatically detect settings". After doing this, GitHub was immediately able to clone the desired repo.
This may not help anyone else, but it worked for me when nothing else did.
Here's an alternate answer if you haven't tried any crazy proxy set up. Make sure that you are adding the repository through github.com or github enterprise instead of using a URL. If you are trying to use a github.com repository via the URL, you'll see the 407 error. Once I realized what I was doing my error went away.
https://i.stack.imgur.com/zaiTs.png
Success story sharing
git config --global http.proxy http://username:password@proxiURL:proxiPort
different from the question'sgit config --global http.proxy http://<username>:<userpsw>@<proxy>:<port>
other than being less correct, because one needs to specify the proxy host, not the URL?