title: pip3 package installation fails with *ReadTimeoutError* regardless of default-timeout setting
body: <h2>The problem</h2>
  <p><strong>On a fresh and minimal Ubuntu 20.04 installation with</strong> <code>ufw</code> <strong>inactive:</strong></p>
  <p><code>pip3</code> fails with HTTPSConnectionPool timeout.</p>
  <p><code>pip3</code> fails to install or update <strong>any</strong> package in a freshly installed OS.</p>
  <p><code>pip3</code> fails with the same error when installing <strong>local wheel files</strong>.</p>
  <p><code>pip3</code> fails in <strong>both</strong> a virtual python environment <strong>and</strong> at the system-level environment.</p>
  <h2>Environment</h2>
  <ul>
  <li>Ubuntu 20.04 LTS
  fresh install,
  <strong>apt</strong> updated/upgraded</li>
  <li>Python 3.8</li>
  </ul>
  <h2>Additional details</h2>
  <p>--default-timeout=100
  <a href="https://i.stack.imgur.com/qeVYa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qeVYa.png" alt="enter image description here" /></a></p>
  <p>--default-timeout=1000
  <a href="https://i.stack.imgur.com/QkhtJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QkhtJ.png" alt="enter image description here" /></a></p>
  <h3>UPDATE:</h3>
  <p>Traceback after user-interrupt <code>python -m pip install -U pip</code></p>
  <pre><code>^CERROR: Operation cancelled by user
  ^CTraceback (most recent call last):
    File &quot;/usr/lib/python3.8/runpy.py&quot;, line 194, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File &quot;/usr/lib/python3.8/runpy.py&quot;, line 87, in _run_code
      exec(code, run_globals)
    File &quot;/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/__main__.py&quot;, line 26, in &lt;module&gt;
      sys.exit(_main())
    File &quot;/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_internal/cli/main.py&quot;, line 75, in main
      return command.main(cmd_args)
    File &quot;/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_internal/cli/base_command.py&quot;, line 114, in main
      return self._main(args)
    File &quot;/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_internal/cli/base_command.py&quot;, line 226, in _main
      self.handle_pip_version_check(options)
    File &quot;/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_internal/cli/req_command.py&quot;, line 158, in handle_pip_version_check
      pip_self_version_check(session, options)
    File &quot;/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_internal/self_outdated_check.py&quot;, line 207, in pip_self_version_check
      best_candidate = finder.find_best_candidate(&quot;pip&quot;).best_candidate
    File &quot;/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_internal/index/package_finder.py&quot;, line 883, in find_best_candidate
      candidates = self.find_all_candidates(project_name)
    File &quot;/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_internal/index/package_finder.py&quot;, line 827, in find_all_candidates
      package_links = self.process_project_url(
    File &quot;/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_internal/index/package_finder.py&quot;, line 792, in process_project_url
      html_page = self._link_collector.fetch_page(project_url)
    File &quot;/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_internal/index/collector.py&quot;, line 612, in fetch_page
      return _get_html_page(location, session=self.session)
    File &quot;/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_internal/index/collector.py&quot;, line 451, in _get_html_page
      resp = _get_html_response(url, session=session)
    File &quot;/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_internal/index/collector.py&quot;, line 149, in _get_html_response
      resp = session.get(
    File &quot;/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_vendor/requests/sessions.py&quot;, line 543, in get
      return self.request('GET', url, **kwargs)
    File &quot;/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_internal/network/session.py&quot;, line 421, in request
      return super(PipSession, self).request(method, url, *args, **kwargs)
    File &quot;/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_vendor/requests/sessions.py&quot;, line 530, in request
      resp = self.send(prep, **send_kwargs)
    File &quot;/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_vendor/requests/sessions.py&quot;, line 643, in send
      r = adapter.send(request, **kwargs)
    File &quot;/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_vendor/cachecontrol/adapter.py&quot;, line 53, in send
      resp = super(CacheControlAdapter, self).send(request, **kw)
    File &quot;/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_vendor/requests/adapters.py&quot;, line 439, in send
      resp = conn.urlopen(
    File &quot;/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_vendor/urllib3/connectionpool.py&quot;, line 665, in urlopen
      httplib_response = self._make_request(
    File &quot;/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_vendor/urllib3/connectionpool.py&quot;, line 376, in _make_request
      self._validate_conn(conn)
    File &quot;/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_vendor/urllib3/connectionpool.py&quot;, line 994, in _validate_conn
      conn.connect()
    File &quot;/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_vendor/urllib3/connection.py&quot;, line 352, in connect
      self.sock = ssl_wrap_socket(
    File &quot;/home/zippy/Documents/python_workspace/py_virt_env/lib/python3.8/site-packages/pip/_vendor/urllib3/util/ssl_.py&quot;, line 370, in ssl_wrap_socket
      return context.wrap_socket(sock, server_hostname=server_hostname)
    File &quot;/usr/lib/python3.8/ssl.py&quot;, line 500, in wrap_socket
      return self.sslsocket_class._create(
    File &quot;/usr/lib/python3.8/ssl.py&quot;, line 1040, in _create
      self.do_handshake()
    File &quot;/usr/lib/python3.8/ssl.py&quot;, line 1309, in do_handshake
      self._sslobj.do_handshake()
  KeyboardInterrupt
  </code></pre>
  <h3>UPDATE</h3>
  <p>Sanity check - OK</p>
  <pre><code>laptop082:468$ curl https://pypi.org:443/simple/pip/
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;meta name=&quot;pypi:repository-version&quot; content=&quot;1.0&quot;&gt;
      &lt;title&gt;Links for pip&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;h1&gt;Links for pip&lt;/h1&gt;
      &lt;a href=&quot;https://files.pythonhosted.org/packages/3d/9d/1e313763bdfb6a48977b65829c6ce2a43eaae29ea2f907c8bbef024a7219/pip-0.2.tar.gz#sha256=88bb8d029e1bf4acd0e04d300104b7440086f94cc1ce1c5c3c31e3293aee1f81&quot;&gt;pip-0.2.tar.gz&lt;/a&gt;&lt;br/&gt;
  .
  .
  .
  </code></pre>
  <h2>Questions</h2>
  <p>What are my options?</p>
  <p>Will a Ubuntu re-install be necessary?</p>
  <h3>UPDATE:</h3>
  <p>Re-installation of Ubuntu 20.04 did not resolve the problem.</p>
  <p>Please advise.</p>