HTTPSConnectionPool error when trying to install gtest with conan

I’m trying to use conan to install gtest but when I do so I have the following error:

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.

However I’m not sure why it doesn’t works
The package do exists ( https://conan.io/center/gtest )
And I’m also using conan to install others packages and I have no issue with them

My full conanfile looks like that:

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

[options]
openssl:shared=True

[generators]
cmake

Would anyone please know why I have this error?
I’m on Windows 11 with conan 1.37.0

Answer

This error is related to deprecated certificate.

It was discussed here: https://github.com/conan-io/conan/issues/9695

To summarize, you have 2 options:

  • Update your Conan client to >= 1.41.0 (Best solution):

    pip install -U conan

  • Install a new certificate (Workaround):

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