简体   繁体   English

配置setuptools的可信主机

[英]Configuring trusted-host for setuptools

When I call pip install for a PyPI repository with an untrusted certificate, I can skip SSL verification by using --trusted-host option: 当我为具有不可信证书的PyPI存储库调用pip install ,可以使用--trusted-host选项跳过SSL验证:

$ pip install googleapis-common-protos --index-url https://maven.mycompany.org/artifactory/api/pypi/pypi-virtual/simple --trusted-host maven.mycompany.org
Looking in indexes: https://maven.mycompany.org/artifactory/api/pypi/pypi-virtual/simple
Collecting googleapis-common-protos
  Downloading https://maven.mycompany.org/artifactory/api/pypi/pypi-virtual/packages/61/29/1549f61917eadd11650e42b78b4afcfe9cb467157af4510ab8cb59535f14/googleapis-common-protos-1.5.6.tar.gz
...
Installing collected packages: googleapis-common-protos
Successfully installed googleapis-common-protos-1.5.6

However, when using setuptools, I see no option to configure it: 但是,使用setuptools时,我看不到配置它的选项:

$ python setup.py test
running pytest
Searching for googleapis-common-protos==1.5.3
Reading https://maven.mycompany.org/artifactory/api/pypi/pypi-virtual/simple/googleapis-common-protos/
Authenticating as uploader for https://maven.mycompany.org/artifactory/api/pypi/pypi-virtual/simple/googleapis-common-protos/ (from .pypirc)
Download error on https://maven.mycompany.org/artifactory/api/pypi/pypi-virtual/simple/googleapis-common-protos/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726) -- Some packages may not be found!

setuptools uses easy_install under the hood, and easy_install doesn't have such option. setuptoolssetuptools使用easy_install ,而easy_install没有这种选择。 See 看到

python setup.py easy_install --help

--trusted-host is only available with pip . --trusted-host仅适用于pip

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

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