python - 使用 sphinx 生成文档时如何禁用 ssl 验证? (在代理后面工作)

标签 python ssl proxy python-sphinx

生成文档时出现以下错误:

loading intersphinx inventory from https://docs.python.org/3/objects.inv...
WARNING: failed to reach any of the inventories with the following issues:
intersphinx inventory 'https://docs.python.org/3/objects.inv' not fetchable due to <class 'requests.exceptions.SSLError'>: HTTPSConnectionPool(host='docs.python.org', port=443): Max retries exceeded with url: /3/objects.inv (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))

我在公司代理人后面工作。

有什么方法可以禁用 ssl 验证吗?就像 anaconda 一样:conda config --set ssl_verify false ?

最佳答案

根据 Sphinx 文档,您可以修改 conf.py 中的两个变量之一,以指定您的证书的路径或一起关闭验证。

  1. tls_verify( bool 值)- 如果为真,Sphinx 将验证服务器认证 LINK
  2. tls_cacert (str) - CA 证书文件的路径或包含证书的目录路径 LINK

它在你的 conf.py 中看起来像这样:

# uncomment this if you don't want to verify at all
# tls_verify = False

tls_cacert = "/path/to/cert"

关于python - 使用 sphinx 生成文档时如何禁用 ssl 验证? (在代理后面工作),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58951952/

相关文章:

Nginx 在监听 proxy_protocol 时捕获 "broken header"

asp.net - 如何使用 ASP.NET 制作一个非常简单的 Web 代理?

使用 Qt4 进行 Python 分散更新 - Qslider

python - 删除 pip 安装的所有软件包的最简单方法是什么?

python - 如何将具有动态维度的张量的每个 2D 元素乘以静态 2D 掩码?

mysql - 如何为所有远程用户要求 SSL

macos - Homebrew OpenSSL : rehash failed to verify, 有问题

reactjs - 当使用两种不同的后端语言时,如何代理 package.json 中的两个 api?

python - Gunicorn 不会启动 Flask 应用程序,因为 "Application object must be callable"

Magento - 结帐页面未加载目录搜索的 https URL