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?


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.

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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