简体   繁体   English

Poetry 是否与 Pip 上可用的标志“--trusted-host”等效?

[英]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,我可以通过执行以下操作来忽略 SSL 错误:

$ 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:如果您拥有公司防火墙使用的根 CA 的证书来注入其“中间人攻击”,则可以在 pyproject.toml 中配置特定的存储库以接受该根 CA:

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.通过将企业防火墙的根 CA 证书添加到 openSSL 的受信任根 CA 列表中,您可以在更全局的层面上完成同样的事情,这样大多数工具将只信任企业防火墙签署的任何内容。 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 .执行此操作的确切方法因操作系统而异,但这里有一些关于 Ubuntu https://ubuntu.com/server/docs/security-trust-store的说明。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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