-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
poetry 1.1.x causes SSLCertVerificationError when installing packages from private repo #3110
Comments
@zyxue can you try setting |
Is it possible to ignore SSL certs in poetry? We have an internal private pypi repository hosted without SSL certs. |
tried but it doesn't seem to be working, still the same error. |
@abn could you please point me to the place in the code how certs file is used differently between poetry 1.0.x and 1.1.x? |
I also have the same problem. The funny thing is that when doing Setting |
Do I understand correctly that you set |
I am seeing the same issue, and can confirm that |
@irremotus , do you mean it's still not working for you even with "certificates.my-private-repo.cert and REQUESTS_CA_BUNDLE are set to the same value"? It's not working for me. |
To make it clear: I've set both |
@zyxue When I set REQUESTS_CA_BUNDLE, both dependency resolution and package installation work. When I set certificates.my-private-repo.cert (and not REQUESTS_CA_BUNDLE), dependency resolution works, but package installation fails, as @absassi mentioned. This worked in previous versions (e.g. 1.0.0), but is failing in recent versions (e.g. 1.1.[1-4]). |
I haven't had a problem with before poetry 1.1.0. Currently, I explicitly set the poetry version to avoid break with I tried with poetry 1.1.4 again, here is what I experienced:
|
@zyxue, since dependency resolution only works when you have the file in Poetry config and the variable is unset, it means that whatever you are setting in the variable is causing the validation to fail (the variable takes precedence over the configuration). Please double check the path for any typos or maybe wrong use of quotes. |
what I have done is basically
am I missing something? |
@zyxue that looks correct to me. Are you using a private repo in addition to PyPI (i.e. no |
No, I was not using
From your reasoning, I feel I'm only having private CAs. (I'm not too familiar with how CA works, and the difference between public and private) After adding
It's kind of confusing why the behavior changed from poetry 1.0.x? |
@zyxue, I think we found the problem then (because I can't think of anything else). so what happens is that you need to use the private source only for private packages, and you still need PyPI for public packages. So, if you use I think there's three ways you can fix this:
As for why this changed, this is simply a bug, as far as I can tell, and hopefully will be fixed soon. |
Thank you for the detailed explanation, @absassi ! Regarding the first solution, based on the log in my last comment, do you have any insight on why it does not have trouble till updating urllib3. In other words, it seems fine downloading pygments and rsa, which I thought are also from the public PyPI? |
@zyxue, I can't say for sure. Maybe they are locally cached and urllib3 is not, or maybe you have pygments and rsa in your private repo? |
@absassi, thank you for your reply! I see, I'll stick to Poetry 1.0.10 till this issue is fixed. |
Workaround on macOSGet selfsigned certFrom within your project directory that contains Download your selfsigned cert or just make sure it is in the project directory curl -O https://examplepathtocacert.com/selfsigned.pem Disable the new installerWARNING:you can no longer revert to the old installer in 1.4.0 as the old installer is depricated If you don't want to build your own REQUESTS_CA_BUNDLE it looks like disabling the new installer from 1.1.x will remove the need for all the REQUESTS_CA_BUNDLE building. You still have to do the poetry config experimental.new-installer false Or build your own REQUESTS_CA_BUNDLEsince macs don't come with a cd $HOME && { curl -O https://curl.se/ca/cacert.pem ; cd -; } The REQUESTS_CA_BUNDLE environment variable wants the full set of certs not just the one you are adding for this repo so we add our cat selfsigned.pem >> $HOME/cacert.pem This temporarily sets export REQUESTS_CA_BUNDLE=$HOME/cacert.pem Setup pypi repoThis adds your private pypi repo to your project config echo '\n[[tool.poetry.source]]\nname = "self-signed-pypi"\nurl = "https://somepypi.com/simple/"' >> pyproject.toml This makes sure the selfsigned cert is configured for the repo. poetry config certificates.self-signed-pypi.cert ./selfsigned.pem Then you can add your package. poetry add your-package-from-self-signed-pypi |
This is still an issue on 1.2.0b3 |
The last set of steps listed by @wjhrdy are correct for a private repo with a self-signed certificate, and should work properly on 1.2.x. If you're still running into issues using them, please open a new issue with a detailed reproduction. If you're trying to replace the certificate for PyPI/files.pythonhosted.org, you'll want to see #1012 -- in short, |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I have a poetry project, configured with a private pypi repo, that used to work well, but after upgrading poetry to 1.1.x (tried 1.1.0 to 1.1.2), it causes error like
when downloading packages that are only available in the private repo.
When I downgrade poetry to 1.0.10, it then works fine.
The text was updated successfully, but these errors were encountered: