欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 文旅 > 八卦 > curl支持ssl报错:SSL certificate problem: unable to get local issuer certificate

curl支持ssl报错:SSL certificate problem: unable to get local issuer certificate

2024/10/24 2:02:37 来源:https://blog.csdn.net/gmq_syy/article/details/143056081  浏览:    关键词:curl支持ssl报错:SSL certificate problem: unable to get local issuer certificate

1. 说明

在使用curl时返回CURLE_OUT_OF_MEMORY,猜想可能是ssl的问题,用curl命令做实验发现访问http没问题,访问https会有问题,根据打印log判断是缺少证书,需要下载证书并声明证书路径。

1.1 curl访问http

访问正常,又返回
在这里插入图片描述

1.2 curl访问https

返回错误:curl: (60) SSL certificate problem: unable to get local issuer certificate
在这里插入图片描述

1.3 添加证书再实验

证书下载路径:https://curl.haxx.se/ca/cacert.pem

export CURL_CA_BUNDLE=/oem/cacert.pem

添加证书后再访问就成功了
在这里插入图片描述
参考:https://blog.csdn.net/lixuande19871015/article/details/88788699
https://blog.csdn.net/qq_31347869/article/details/129721658

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com