Skip to content

SSL Error when installing using private repository with https in pip==20.3 #9182

@twheys

Description

@twheys

Environment

  • pip version: 20.3
  • Python version: 3.6.8
  • OS: CentOS 7.7.1908 x86_64

Description

Running the command

pip3 install -U \
    --trusted-host pypi.python.org \
    --trusted-host {redacted} \
    -r requirements.txt

pip.conf

[global]
extra-index = https://{redacted}/repository/python/pypi
extra-index-url = https://{redacted}/repository/python/simple

Getting an SSL error raised trying to install from pypi and my private repository.

30-Nov-2020 12:54:54 | ERROR: Command errored out with exit status 1:
-- | --
30-Nov-2020 12:54:54 | command: venv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'pip-install-_vatl_q7/pytest_63d4a274a4e64ac4a2c6beaff19454cd/setup.py'"'"'; __file__='"'"'pip-install-_vatl_q7/pytest_63d4a274a4e64ac4a2c6beaff19454cd/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-pip-egg-info-plmmsf24
30-Nov-2020 12:54:54 | cwd: pip-install-_vatl_q7/pytest_63d4a274a4e64ac4a2c6beaff19454cd/
30-Nov-2020 12:54:54 | Complete output (31 lines):
30-Nov-2020 12:54:54 | Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.14.tar.gz
30-Nov-2020 12:54:54 | Traceback (most recent call last):
30-Nov-2020 12:54:54 | File "pip-install-_vatl_q7/pytest_63d4a274a4e64ac4a2c6beaff19454cd/distribute_setup.py", line 143, in use_setuptools
30-Nov-2020 12:54:54 | raise ImportError
30-Nov-2020 12:54:54 | ImportError
30-Nov-2020 12:54:54 |  
30-Nov-2020 12:54:54 | During handling of the above exception, another exception occurred:
30-Nov-2020 12:54:54 |  
30-Nov-2020 12:54:54 | Traceback (most recent call last):
30-Nov-2020 12:54:54 | File "<string>", line 1, in <module>
30-Nov-2020 12:54:54 | File "pip-install-_vatl_q7/pytest_63d4a274a4e64ac4a2c6beaff19454cd/setup.py", line 4, in <module>
30-Nov-2020 12:54:54 | use_setuptools()
30-Nov-2020 12:54:54 | File "pip-install-_vatl_q7/pytest_63d4a274a4e64ac4a2c6beaff19454cd/distribute_setup.py", line 145, in use_setuptools
30-Nov-2020 12:54:54 | return _do_download(version, download_base, to_dir, download_delay)
30-Nov-2020 12:54:54 | File "pip-install-_vatl_q7/pytest_63d4a274a4e64ac4a2c6beaff19454cd/distribute_setup.py", line 124, in _do_download
30-Nov-2020 12:54:54 | to_dir, download_delay)
30-Nov-2020 12:54:54 | File "pip-install-_vatl_q7/pytest_63d4a274a4e64ac4a2c6beaff19454cd/distribute_setup.py", line 193, in download_setuptools
30-Nov-2020 12:54:54 | src = urlopen(url)
30-Nov-2020 12:54:54 | File "/usr/lib64/python3.6/urllib/request.py", line 223, in urlopen
30-Nov-2020 12:54:54 | return opener.open(url, data, timeout)
30-Nov-2020 12:54:54 | File "/usr/lib64/python3.6/urllib/request.py", line 532, in open
30-Nov-2020 12:54:54 | response = meth(req, response)
30-Nov-2020 12:54:54 | File "/usr/lib64/python3.6/urllib/request.py", line 642, in http_response
30-Nov-2020 12:54:54 | 'http', request, response, code, msg, hdrs)
30-Nov-2020 12:54:54 | File "/usr/lib64/python3.6/urllib/request.py", line 570, in error
30-Nov-2020 12:54:54 | return self._call_chain(*args)
30-Nov-2020 12:54:54 | File "/usr/lib64/python3.6/urllib/request.py", line 504, in _call_chain
30-Nov-2020 12:54:54 | result = func(*args)
30-Nov-2020 12:54:54 | File "/usr/lib64/python3.6/urllib/request.py", line 650, in http_error_default
30-Nov-2020 12:54:54 | raise HTTPError(req.full_url, code, msg, hdrs, fp)
30-Nov-2020 12:54:54 | urllib.error.HTTPError: HTTP Error 403: SSL is required
30-Nov-2020 12:54:54 | ----------------------------------------
30-Nov-2020 12:54:54 | ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Rolling back to pip==20.2.4 fixes the issue for me.

Expected behavior

Setting --trusted-host option should resolve the issue with SSL.

How to Reproduce

Not really sure, but seems like installing from a private repository using HTTPS seems to be the cause.

Output

Paste the output of the steps above, including the commands themselves and
pip's output/traceback etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions