Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Over the weekend, our IT department installed an updated firewall. As a result, we are no longer able to pull from (and push to) the repository on BitBucket.

Attempting to perform a Mercurial operation (pull, for example) results in the message [Errno 10053] An established connection was aborted by the software in your host machine.

Obviously something is going wrong in the communication sequence, but I am not familiar enough with the protocol to be able to identify what. I suspect that Mercurial expects to use a port that is now blocked. Which port(s) should be open to allow Mercurial to operate correctly with repositories hosted on BitBucket.org?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

There are two ports in use, depending on the protocol:

  • HTTPS: port 443. This is used for hg clone, hg pull, and hg push with https://bitbucket.org/<user>/<repo>/ URLs.

    It is also used for normal browsing on Bitbucket using the webbrowser. In other words, if you can access Bitbucket with you browser, then Mercurial should also work.

  • SSH: port 22. This is used for hg clone, hg pull, and hg push with ssh://hg@bitbucket.org/<user>/<repo>/ URLs.

Mercurial is not doing anything special — it just sends normal traffic on these ports.

Your IT department should be able to tell if they're blocking connection attempts from the inside of their firewall (by looking at their logs). You should also look into your proxy settings if the problem persists.

share|improve this answer
Thanks Martin, that's what I thought. Our IT department was seeing a blockage. The firewall was blocking the outbound traffic from the internal machines because the firewall's "HTTP protocol TLS/SSL" option was not enabled, and it needed to be. –  Richard J Foster Mar 27 '12 at 18:13
@RichardJFoster: No problem, glad you got it solved! Now we have the ports documented here for further reference. –  Martin Geisler Mar 27 '12 at 21:34

Well, it turns out that this statement is not true: "... if you can access BitBucket with you [sic] browser, then Mercurial should also work."

I don't know how, but I can reach BitBucket from IE, but Mercurial times out. It isn't an IE-configured proxy (they have an invisible proxy), and it isn't an application defined in the Windows Firewall. Frankly, I don't know how they're blocking me on Mercurial, but I have a site that does. (Packet sniffer, looking at the browser client? It runs pretty darned fast, if that's how they're doing it, and I can't imagine why they would.)

Don't mean to hijack this thread, but it might help someone else. And if anyone out there might know of a method for making this happen, I'd be interested out of professional curiosity.

share|improve this answer
Do you have any Anti-Virus software? Some of that (for example McAfee) has options to block "unauthorized" applications from HTTP/HTTPS. –  Richard J Foster Apr 5 '13 at 12:48
I also have exactly the same problem. I've used traffic sniffing, and the exact same HTTP request that hg uses works fine in Telnet, IE, Firefox and Chrome, but as soon as hg send it, the firewall replies with "This page has been blocked by the administrator". For anyone interested, the firewall is SonicWALL. –  Saul Apr 11 '13 at 20:23
Fixed: add the IP to the firewall whitelist as well as the domain. –  Saul Apr 12 '13 at 10:14
McAfee, though it's locked and I don't have access. Assuming that's the block, it's allowing me to browse, but not download? Is that the idea? Makes sense. Thanks! –  knockNrod Jun 28 '13 at 17:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.