poetry
doesn't seem to respect poetry config certificates.pypi.cert false
. Getting CERTIFICATE_VERIFY_FAILED
#6681
-
IssueI'm behind a corporate firewall which I cannot change. I won't pretend to know what's really going on here, but we're swapping out some of the SSL certificates with our own, self-signed certificate. This poses problems when trying to pip install packages on pypi. but for plain ol' pip installs, my team just runs this
and we're good to go, but When I try to add a package via
So I tried running However even after setting this, I still get:
I've tried modifying the source code of |
Beta Was this translation helpful? Give feedback.
Replies: 18 comments 18 replies
-
Poetry calls the pypi repository "PyPI", not "pypi" |
Beta Was this translation helpful? Give feedback.
-
I tried |
Beta Was this translation helpful? Give feedback.
-
You sure about that? If I
which surely implies that this is doing the expected thing? |
Beta Was this translation helpful? Give feedback.
-
So overriding where pypi resolves in my hosts file to my own webserver that's listening on 443:
Looking at my web logs: So this does appear to work as @dimbleby mentions. |
Beta Was this translation helpful? Give feedback.
-
Indeed I get the warnings, but I still get the same error.
This is probably due to whatever is going on with my company's corporate firewall, but nevertheless I'm able to get regular ol' pip to work. I also had the same problem with We're using a self-signed certificate, hence |
Beta Was this translation helpful? Give feedback.
-
It sounds like Poetry may work with untrusted CAs but not self-signed certificates, which would explain why this keeps popping up and the team keeps on being unable to reproduce it. I would suggest a PR that ensures we allow self-signed certificates as well, if requests indeed handles them differently. |
Beta Was this translation helpful? Give feedback.
-
The second error is not the same error at all: |
Beta Was this translation helpful? Give feedback.
-
🤦🏼 good catch @dimbleby -- the issue is that PyPI hosts files on a different domain. |
Beta Was this translation helpful? Give feedback.
-
So I've successfully disabled SSL for |
Beta Was this translation helpful? Give feedback.
-
you have a repro and so better placed than we are to answer such questions - try it! (and let us know the answer) |
Beta Was this translation helpful? Give feedback.
-
You could add a publishing repository for the sole purpose of disabling verification, which I think should work. In the long run, I'm not sure how to solve this in an intuitive way yet. poetry config repositories.FPHO https://files.pythonhosted.org
poetry config certificates.FPHO.cert false |
Beta Was this translation helpful? Give feedback.
-
This got me much farther! Thanks for the idea 🙇
So I guess |
Beta Was this translation helpful? Give feedback.
-
Looks like an issue with our usage of pip instead -- though I'm not sure why a temporary requirements file is in use. Are you using the old installer? |
Beta Was this translation helpful? Give feedback.
-
I used |
Beta Was this translation helpful? Give feedback.
-
I'm referring to |
Beta Was this translation helpful? Give feedback.
-
Also, I'm migrating this to a discussion as it has become clear this is more of a how-to/discussion on how we can make this use case easier, as PyPI's modern architecture works across multiple domains. |
Beta Was this translation helpful? Give feedback.
-
As you can see, poetry here is just shelling out to pip: this error should reproduce if you run the same pip command directly. Probably it's something in your environment or pip.conf that is making it unhappy. I guess maybe you've tried a few things to get this working... anyway #6531 should now be isolating pip from such things. |
Beta Was this translation helpful? Give feedback.
-
What @dimbleby is suggesting is that if you run the D:\myrepo\venv\Scripts\python.exe -m pip install --use-pep517 --disable-pip-version-check --prefix D:\myrepo\venv --no-deps C:\Users\me\AppData\Local\pypoetry\Cache\artifacts\08\66\7b\1a9492a47005b40f397a38657516036bfc2103d6a0c48185056aa85a00\pysmb-1.2.8.zip Indeed, Alternatively, you can add Eventually #6205 will solve this -- pip is currently an implementation detail of Poetry and we are working to break our dependence. It may be worth exploring if we can pass |
Beta Was this translation helpful? Give feedback.
What @dimbleby is suggesting is that if you run the
pip
invocation that Poetry uses faithfully, it will fail as well, as the issue is occurring at the pip-Poetry boundary:Indeed,
pip
here is unaware of any--trusted-host
you might use in another invocation as there is no persistence of command line flags! You can add--trusted-host
topip.conf
as per the docs and Poetry will respect it for now (we're adding--isolated
in the future, …