简体   繁体   中英

Does Poetry have an equivalent for the flag "--trusted-host" that is available on Pip?

I wish to start using poetry on some projects at work, where I am stuck behind corporate filters that sometimes interfere with certs.

If I use pip, I can ignore SSL errors by doing something like the below:

$ pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org <package_name>

Does something like this exist for poetry, be it a command line argument or configuration values to be put into the lock file?

If you have the certificate of the root CA that is being used by your corporate firewall to inject its "man-in-the-middle attack", you can configure a particular repository to accept that root CA in pyproject.toml:

poetry config certificates.foo.cert /path/to/ca.pem

You can accomplish the same thing on a more global level by adding your corporate firewall's root CA certificate to the trusted root CA list for openSSL, so that most tools will just trust anything signed by your corporate firewall. You've probably already done the equivalent for your browser, which maintains its own trust list. The exact way to do that varies by operating system, but here are some instructions for Ubuntu https://ubuntu.com/server/docs/security-trust-store .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM