生成文档时出现以下错误:
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
中的两个变量之一,以指定您的证书的路径或一起关闭验证。
它在你的 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/