title: Mercurial https clone: "abort: error: (...) wrong version number"
body: <p>I have problem with mercurial on OS X 10.9.1
  I have a repository on bitbucket with couple files, when I'm trying to clone it I'm getting an error: </p>
  
  <pre><code>mac-mini-jakub:testrepo kubeczek$ hg clone https://kubecz3k@bitbucket.org/kubecz3k/test 
  abort: error: _ssl.c:507: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number
  </code></pre>
  
  <p>I have installed Mercurial 2.8.2 for MacOS X 10.9 from <a href="https://www.mercurial-scm.org/downloads/" rel="noreferrer">https://www.mercurial-scm.org/downloads/</a></p>
  
  <p>I'm pretty sure that on the side of the bitbucket everything is ok, because I have no problem on linux machine.</p>
  
  <p>here is the full traceback:</p>
  
  <pre><code>mac-mini-jakub:testrepo kubeczek$ hg clone https://kubecz3k@bitbucket.org/kubecz3k/test --traceback
  Traceback (most recent call last):
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 133, in _runcatch
      return _dispatch(req)
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 806, in _dispatch
      cmdpats, cmdoptions)
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 585, in runcommand
      ret = _runcommand(ui, options, cmd, d)
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 897, in _runcommand
      return checkargs()
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 868, in checkargs
      return cmdfunc()
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 803, in &lt;lambda&gt;
      d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/util.py", line 512, in check
      return func(*args, **kwargs)
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/commands.py", line 1286, in clone
      branch=opts.get('branch'))
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/hg.py", line 268, in clone
      srcpeer = peer(ui, peeropts, source)
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/hg.py", line 122, in peer
      return _peerorrepo(rui, path, create).peer()
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/hg.py", line 102, in _peerorrepo
      obj = _peerlookup(path).instance(ui, path, create)
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httppeer.py", line 238, in instance
      inst._fetchcaps()
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httppeer.py", line 57, in _fetchcaps
      self.caps = set(self._call('capabilities').split())
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httppeer.py", line 171, in _call
      fp = self._callstream(cmd, **args)
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httppeer.py", line 118, in _callstream
      resp = self.urlopener.open(req)
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 404, in open
      response = self._open(req, data)
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 422, in _open
      '_open', req)
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 382, in _call_chain
      result = func(*args)
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/url.py", line 368, in https_open
      return self.do_open(self._makeconnection, req)
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/keepalive.py", line 257, in do_open
      raise urllib2.URLError(err)
  URLError: &lt;urlopen error [Errno 1] _ssl.c:507: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number&gt;
  abort: error: _ssl.c:507: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number
  </code></pre>
  
  <p>My Python version is:</p>
  
  <pre><code>mac-mini-jakub:~ kubeczek$ python -V
  Python 2.7.6
  </code></pre>
  
  <p>And SSL:</p>
  
  <pre><code>&gt;&gt;&gt; print _ssl.OPENSSL_VERSION
  OpenSSL 0.9.8y 5 Feb 2013
  </code></pre>
  
  <p>I will appreciate every help, thanks! </p>