尝试使用 conan 安装 gtest 时出现 HTTPSConnectionPool 错误

Xwi*_*arg 5 c++ cmake googletest conan

我正在尝试使用 conan 来安装 gtest,但是当我这样做时出现以下错误:

gtest/1.11.0: Not found in local cache, looking in remotes...
gtest/1.11.0: Trying with 'conancenter'...
ERROR: HTTPSConnectionPool(host='center.conan.io', port=443): Max retries exceeded with url: /v1/ping (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),))

Unable to connect to conancenter=https://center.conan.io
1. Make sure the remote is reachable or,
2. Disable it by using conan remote disable,
Then try again.
Run Code Online (Sandbox Code Playgroud)

但是我不确定为什么它不起作用
该包确实存在(https://conan.io/center/gtest
而且我还使用 conan 来安装其他包,我对它们没有任何问题

我的完整 conan 文件如下所示:

[requires]
libcurl/7.78.0
cjson/1.7.15
gtest/1.11.0

[options]
openssl:shared=True

[generators]
cmake
Run Code Online (Sandbox Code Playgroud)

有人知道我为什么会出现这个错误吗?
我使用的是 Windows 11,柯南 1.37.0

uil*_*ies 8

此错误与已弃用的证书有关。

这里讨论过:https ://github.com/conan-io/conan/issues/9695

总而言之,您有 2 个选择:

  • 将您的 Conan 客户端更新到 >= 1.41.0(最佳解决方案):

    pip install -U conan

  • 安装新证书(解决方法):

    conan config install https://github.com/conan-io/conanclientcert.git