带 TLS 的 Nexus 存储库:conda 不工作

Nexus Repository with TLS: conda not working

我已经在内部服务器 (Windows) 上安装了 Nexus 存储库,并在我的笔记本电脑 (Windows) 上按预期运行。然后我使用自签名证书根据来自 sonatype 的 this guide 启用 TLS/https。我可以使用 https 连接到存储库管理器,它工作正常。

证书是在 this guide also from sonatype. From that I go my nexus.pem file. According to the conda docs 之后创建的 我将该文件添加到环境变量 REQUESTS_CA_BUNDLE。

然后我调整了我的 conda 和 pip 配置以使用 https 连接到 nexus。然而,即使 https 在浏览器中工作,当尝试使用 conda 安装任何东西时,我也会收到 HTTPError:

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://myserver.com:8443/repository/anaconda-proxy/main/win-64/repodata.json>
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
'https://myserver.com:8443/repository/anaconda-proxy/main/win-64'

我可以将错误中的 link 复制并粘贴到我的浏览器中,它工作正常。因此,我唯一的解释是 ssl 证书存在一些问题,但错误并未显示问题所在。

如何获得更有意义的错误?或者我该如何解决这个问题?

编辑:

确实是证书的问题。如果我删除 REQUESTS_CA_BUNDLE 并设置

conda config --set ssl_verify False

然后就可以了。但这并不是我真正想要的。

在此处发布后,我可以搜索并尝试解决问题数小时和数分钟,我找到了解决方案。发生的太频繁了啊

简单地说,错误是我自己的错。自签名证书是 example.mycompany.com 的问题,但在 .condarc 文件中,我只使用别名(例如 https://example/repository/anaconda-proxy/main/ 而不是完整的主机名(例如 https://example.mycompany.com/repository/anaconda-proxy/main/