Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow pdm python install to use system certificates #2759

Closed
stfdxv opened this issue Apr 2, 2024 · 0 comments · Fixed by j178/pdm#1
Closed

Allow pdm python install to use system certificates #2759

stfdxv opened this issue Apr 2, 2024 · 0 comments · Fixed by j178/pdm#1
Labels
⭐ enhancement Improvements for existing features

Comments

@stfdxv
Copy link

stfdxv commented Apr 2, 2024

Is your feature/enhancement proposal related to a problem? Please describe.

My machine is behind a corporate proxy, so SSL certificates from certifi won't work. When I do pdm python install 3.12 -v, I get an error.

Error
PS C:\Users\<username>> pdm python install 3.12 -v
STATUS: Downloading [email protected]
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "c:\users\<username>\.local\bin\pdm.exe\__main__.py", line 7, in <module>
  File "C:\Users\<username>\pipx\venvs\pdm\Lib\site-packages\pdm\core.py", line 341, in main
    return core.main(args or sys.argv[1:])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<username>\pipx\venvs\pdm\Lib\site-packages\pdm\core.py", line 259, in main
    raise cast(Exception, err).with_traceback(traceback) from None
  File "C:\Users\<username>\pipx\venvs\pdm\Lib\site-packages\pdm\core.py", line 254, in main
    self.handle(project, options)
  File "C:\Users\<username>\pipx\venvs\pdm\Lib\site-packages\pdm\core.py", line 209, in handle
    command.handle(project, options)
  File "C:\Users\<username>\pipx\venvs\pdm\Lib\site-packages\pdm\cli\commands\python.py", line 99, in handle
    self.install_python(project, options.version)
  File "C:\Users\<username>\pipx\venvs\pdm\Lib\site-packages\pdm\cli\commands\python.py", line 124, in install_python
    original_filename = download(python_file, tf.name)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<username>\pipx\venvs\pdm\Lib\site-packages\pbs_installer\_install.py", line 99, in download
    with client.stream("GET", url, headers=_get_headers()) as resp:
  File "C:\Program Files\Python312\Lib\contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "C:\Users\<username>\pipx\venvs\pdm\Lib\site-packages\httpx\_client.py", line 870, in stream
    response = self.send(
               ^^^^^^^^^^
  File "C:\Users\<username>\pipx\venvs\pdm\Lib\site-packages\httpx\_client.py", line 914, in send
    response = self._send_handling_auth(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<username>\pipx\venvs\pdm\Lib\site-packages\httpx\_client.py", line 942, in _send_handling_auth
    response = self._send_handling_redirects(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<username>\pipx\venvs\pdm\Lib\site-packages\httpx\_client.py", line 979, in _send_handling_redirects
    response = self._send_single_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<username>\pipx\venvs\pdm\Lib\site-packages\httpx\_client.py", line 1015, in _send_single_request
    response = transport.handle_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<username>\pipx\venvs\pdm\Lib\site-packages\httpx\_transports\default.py", line 232, in handle_request
    with map_httpcore_exceptions():
  File "C:\Program Files\Python312\Lib\contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "C:\Users\<username>\pipx\venvs\pdm\Lib\site-packages\httpx\_transports\default.py", line 86, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)

Describe the solution you'd like

It would be great if pdm, while installing python, could use system certificates by default or expose a configuration switch to do it.

@stfdxv stfdxv added the ⭐ enhancement Improvements for existing features label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⭐ enhancement Improvements for existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant