title: pip fails to make a secure connection to pypi server
body: <p>Yesterday I tried to install some python packages with pip and it just won't work.</p>
  
  <pre><code>paquete@paquete-ultrabook:~$ pip install isort -v
  Downloading/unpacking isort
    Could not fetch URL https://pypi.python.org/simple/isort/: connection error: [Errno 0] _ssl.c:344: error:00000000:lib(0):func(0):reason(0)
    Will skip URL https://pypi.python.org/simple/isort/ when looking for download links for isort
    Could not fetch URL https://pypi.python.org/simple/: connection error: [Errno 0] _ssl.c:344: error:00000000:lib(0):func(0):reason(0)
    Will skip URL https://pypi.python.org/simple/ when looking for download links for isort
    Cannot fetch index base URL https://pypi.python.org/simple/
    Could not fetch URL https://pypi.python.org/simple/isort/: connection error: [Errno 0] _ssl.c:344: error:00000000:lib(0):func(0):reason(0)
    Will skip URL https://pypi.python.org/simple/isort/ when looking for download links for isort
    Could not find any downloads that satisfy the requirement isort
  Cleaning up...
    Removing temporary dir /tmp/pip_build_paquete...
  No distributions at all found for isort
  Exception information:
  Traceback (most recent call last):
    File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
      status = self.run(options, args)
    File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 278, in run
      requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
    File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1177, in prepare_files
      url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
    File "/usr/lib/python2.7/dist-packages/pip/index.py", line 277, in find_requirement
      raise DistributionNotFound('No distributions at all found for %s' % req)
  DistributionNotFound: No distributions at all found for isort
  
  Storing debug log for failure in /tmp/tmpl86YQE
  </code></pre>
  
  <p>I've been arround searching for an answer in the internet without success. A lot of answers from 2012 suggest to downgrade, but the bug that was troublesome had been fixed since that.</p>
  
  <pre><code>paquete@paquete-ultrabook:~$ pip -V
  pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)
  </code></pre>
  
  <p>Some people had issues with their python interpreter, but it seems to connect fine to the server.</p>
  
  <pre><code>paquete@paquete-ultrabook:~$ python
  Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
  [GCC 4.8.2] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; import httplib
  &gt;&gt;&gt; conn = httplib.HTTPSConnection("pypi.python.org")
  &gt;&gt;&gt; conn.request("GET","/simple/")
  &gt;&gt;&gt; res = conn.getresponse()
  &gt;&gt;&gt; print res.status, res.reason
  200 OK
  </code></pre>
  
  <p>As additional information, I did an elementaryos fresh install a few weeks ago. This happens to ALL packages. I have installed everything through apt, so this seems  Any ideas?</p>
  
  <p><strong>Update</strong>
  Following the suggestion by @andersson I tried to install pip's latest version. Then this poped out</p>
  
  <pre><code>paquete@paquete-ultrabook:~$ sudo python3 Downloads/get-pip.py -v
  The directory '/home/paquete/.cache/pip/log' or its parent directory is not owned by the current user and the debug log has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
  The directory '/home/paquete/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
  Starting new HTTPS connection (1): pypi.python.org
  There was an error checking the latest version of pip
  Traceback (most recent call last):
    File "/tmp/tmp8w985p0e/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py", line 253, in ssl_wrap_socket
      context.load_verify_locations(ca_certs)
  ssl.SSLError: unknown error (_ssl.c:2734)
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/tmp/tmp8w985p0e/pip.zip/pip/_vendor/requests/adapters.py", line 370, in send
      timeout=timeout
    File "/tmp/tmp8w985p0e/pip.zip/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 544, in urlopen
      body=body, headers=headers)
    File "/tmp/tmp8w985p0e/pip.zip/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 341, in _make_request
      self._validate_conn(conn)
    File "/tmp/tmp8w985p0e/pip.zip/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 762, in _validate_conn
      conn.connect()
    File "/tmp/tmp8w985p0e/pip.zip/pip/_vendor/requests/packages/urllib3/connection.py", line 238, in connect
      ssl_version=resolved_ssl_version)
    File "/tmp/tmp8w985p0e/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py", line 255, in ssl_wrap_socket
      raise SSLError(e)
  pip._vendor.requests.packages.urllib3.exceptions.SSLError: unknown error (_ssl.c:2734)
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/tmp/tmp8w985p0e/pip.zip/pip/utils/outdated.py", line 126, in pip_version_check
      headers={"Accept": "application/json"},
    File "/tmp/tmp8w985p0e/pip.zip/pip/_vendor/requests/sessions.py", line 476, in get
      return self.request('GET', url, **kwargs)
    File "/tmp/tmp8w985p0e/pip.zip/pip/download.py", line 367, in request
      return super(PipSession, self).request(method, url, *args, **kwargs)
    File "/tmp/tmp8w985p0e/pip.zip/pip/_vendor/requests/sessions.py", line 464, in request
      resp = self.send(prep, **send_kwargs)
    File "/tmp/tmp8w985p0e/pip.zip/pip/_vendor/requests/sessions.py", line 576, in send
      r = adapter.send(request, **kwargs)
    File "/tmp/tmp8w985p0e/pip.zip/pip/_vendor/cachecontrol/adapter.py", line 46, in send
      resp = super(CacheControlAdapter, self).send(request, **kw)
    File "/tmp/tmp8w985p0e/pip.zip/pip/_vendor/requests/adapters.py", line 431, in send
      raise SSLError(e, request=request)
  pip._vendor.requests.exceptions.SSLError: unknown error (_ssl.c:2734)
  </code></pre>
  
  <p>It seems to be a generic problem.</p>