Cannot fetch urls from outside the browser

2

I am trying to clone a small repo on my Windows 7 PC using 'msysgit' bash command like as follows:

talha.ahmed@ICE-088 /d/talha.ahmed/workspace/repos
$ git clone https://github.com/torvalds/linux

but am unable to do so and get the following output

Cloning into 'linux'...
fatal: unable to access 'https://github.com/torvalds/linux/': Failed connect to   github.com:443; No error

Or

Cloning into 'linux'...
error: RPC failed; result=7, HTTP code = 0
fatal: The remote end hung up unexpectedly

and Using python 2.6, I have found that the problem is not git specific:

In [3]: import urllib2
In [4]: urllib2.urlopen('https://www.example.com').read()
Traceback (most recent call last):
  File "<ipython-input-4-d382603dc753>", line 1, in <module>
    urllib2.urlopen('https://www.example.com').read()
  File "c:\Python26\lib\urllib2.py", line 126, in 
    urlopen   return _opener.open(url, data, timeout)
  File "c:\Python26\lib\urllib2.py", line 391, in open
    response = self._open(req, data)
  File "c:\Python26\lib\urllib2.py", line 409, in _open
    '_open', req)
  File "c:\Python26\lib\urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "c:\Python26\lib\urllib2.py", line 1178, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "c:\Python26\lib\urllib2.py", line 1145, in do_open
    raise URLError(err)

URLError: <urlopen error [Errno 10061] No connection could be made because the target machine actively refused it>

However, I can access the url perfectly fine through the browser and download. There is no proxy configured (I use a gateway configuration on LAN at work).

How is this possible? Can it be due to some proxy configuration at the company gateway ? Or can it also be due to some policy configuration enforced by Kaspersky Endpoint Security 10? How should i go about finding the cause of the problem?

Update:

The problem seems to have gone away on its own. Those couple of days were actually particularly bad internet days at work with noisy and broken DSL lines and such. But, I still don't know why I was consistently unsuccessful to access using git or python but the with the browser it was most often successful. Can it be due to some settings that affects the GETs or POSTs such as timeout etc.?

LazyLeopard

Posted 2013-12-18T13:27:23.817

Reputation: 21

Shouldn't you use https://github.com/torvalds/linux.git ?

– m4573r – 2013-12-18T13:31:02.523

After trying, it does not seem to make a difference. I guess the .git is implied. – LazyLeopard – 2013-12-18T13:43:34.263

Answers

0

Failed connect to github.com:443; No error

You should test your network connectivity, for example by the following shell command:

ssh -vvvT git@github.com

or over HTTPS:

ssh -vvvT -p 443 git@ssh.github.com

If you're behind the proxy, use ProxyHandler to specify it.

See also: Why am I getting the error “connection refused” in Python?

For debugging git issues, see: How can I debug git/git-shell related problems?


URLError: urlopen error [Errno 10061]

Try changing HTTPS to HTTP, or use requests instead.

kenorb

Posted 2013-12-18T13:27:23.817

Reputation: 16 795