Conan安装第三方依赖库时SSL验证失败解决办法

背景

c++跨平台项目使用conan进行三方库依赖管理是比较通用的方案,更换开发环境后突然发现conan无法安装三方库了,报错如下:

复制代码
zlib/1.2.12: Not found in local cache, looking in remotes...
zlib/1.2.12: Trying with 'conan-center'...
ERROR: Failed requirement 'zlib/1.2.12' from 'conanfile.py (QtConanExample/None)'
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 conan-center=https://center.conan.io
1. Make sure the remote is reachable or,
2. Disable it by using conan remote disable,
Then try again.
CMake Error at build/conan.cmake:651 (message):
  Conan install failed='1'
Call Stack (most recent call first):
  CMakeLists.txt:199 (conan_cmake_install)


-- Configuring incomplete, errors occurred!

字面意思就是SSL证书验证失败了。

解决办法

删除~/.conan/cacert.pem, 然后重试即可。

相关推荐
特立独行的猫a1 天前
C++轻量级Web框架介绍与对比:Crow与httplib
开发语言·前端·c++·crow·httplib
YXXY3131 天前
模拟实现map和set
c++
阿猿收手吧!1 天前
【C++】引用类型全解析:左值、右值与万能引用
开发语言·c++
「QT(C++)开发工程师」1 天前
C++ 策略模式
开发语言·c++·策略模式
似霰1 天前
Linux timerfd 的基本使用
android·linux·c++
三月微暖寻春笋1 天前
【和春笋一起学C++】(五十八)类继承
c++·派生类·类继承·基类构造函数·派生类构造函数
热爱编程的小刘1 天前
Lesson05&6 --- C&C++内存管理&模板初阶
开发语言·c++
czy87874751 天前
深入了解 C++ 中的 Lambda 表达式(匿名函数)
c++
CSDN_RTKLIB1 天前
include_directories和target_include_directories说明
c++
Trouvaille ~1 天前
【Linux】UDP Socket编程实战(二):网络字典与回调设计
linux·运维·服务器·网络·c++·udp·操作系统