3

I'm tryng to start using Git on GitHub. Unfortunately I can't manage to get it working, I always receive, when I try to clone the repository, the message "Connection refused". Since I'm behind a proxy server I suppose the problem is there, but I don't know how to fix.

enter image description here

Below what I tryed so far: I open the account on GitHub then I generated a key with putty gen: enter image description here I saved the private key (2) on the disk and sent the public(1) into the github place for SSH keys: enter image description here Then I used the private key in the clone phase as below: enter image description here

This did not work for me, so I tryed to authenticate with my proxy using Cntlm and setting it to point the enterprise proxy. Then I changed the tortoisegit configuration as below: enter image description here

but when I try to clone I'm always facing the "Connection Refused" error. The Cntlm configuration file looks like:

Username    fpollano
Domain      mydomain
PassLM          93D6A9F56CD43B4571101CC5806411F2
PassNT          5FD9AD7F1504A469D994241648972131
PassNTLMv2      7255AE1CBA2511A751F848FC34087011    
#Workstation    netbios_hostname    # Should be auto-guessed

Proxy       192.168.1.5:8080

( I even check with clear password, with same results )

Anyone know a solution ? Alternatively any way to get some of these agents log something somewhere ? Thanks to all !

Michael
  • 41,989
  • 11
  • 82
  • 128
Felice Pollano
  • 32,832
  • 9
  • 75
  • 115

2 Answers2

1

On windows, it will help if you have the following environment variables defined before any pull/push using https GitHub address:

http_proxy="http://username:password@proxy:port/"
https_proxy="http://username:password@proxy:port/"
HOME=C:\Path\To\HOME

(http_proxy in lowercase)

Your %HOME% (which isn't defined by default on Windows) can be any path, but it must be the parent directory of your .ssh which contains your id_rsa.pub and id_rsa files (your public and private keys)

In your %HOME%, you will also need an _netrc file:

machine github.com
login loginGitHub
password passwordGitHub

From there, you will be able to clone your GitHub repo:

git clone https://github.com/Login/repo

To debug those kind of connection errors, set GIT_CURL_VERBOSE=1, and make sure your CApath is correct.

git config --system http.sslcainfo "C:\path\to\your\git\bin\curl-ca-bundle.crt"
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks for you reply. Unfortunately the error is the same. BTW, do you really need to put my password in clear in all that places ? – Felice Pollano Sep 06 '11 at 08:57
  • @Felice: for the proxy and curl, yes, you need to put your passwords (one for the proxy, one for your GitHub account). That is why I usually define a `HOME` in a private directory (the windows `HOMEDIR` or any network directory accessible only by me). Regarding your errors, did you try first to clone through the command line? If yes, what is the output with `GIT_CURL_VERBOSE=1`? – VonC Sep 06 '11 at 09:39
  • well I tried with gitbash and the output is:ssh: connect to host github.com port 22: Bad file number fatal: The remote end hung up unexpectedly ( in any case +1 for your patience :) ) – Felice Pollano Sep 06 '11 at 10:07
  • ok, I'm an idiot: i figured out that I was not using https:// when cloning from tortoise, but git, so it wanto to use port 22. It's ok thanks for your help – Felice Pollano Sep 06 '11 at 10:13
  • 1
    @Felice: Excellent :) So, the output did help (which is why I prefer debug first in command-line, and then use the graphic tool) – VonC Sep 06 '11 at 10:15
0

I had this issue. Our Sys admin forced Internet traffic to go through a proxy and I was suddenly unable to push/pull to/from GitHub. I tried VonC's answer with no luck. Fortunately our Sys Admin whitelisted github.com on the Firewall and I was back in business. So it doesn't hurt to ask. :)

James Lawruk
  • 30,112
  • 19
  • 130
  • 137