curl请求https报错
curl 一般情况下请求http时不会有问题
但是请求 https 协议的链接时会报错,如下:
curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
解决办法:
1、到 curl 的官网上去下载一个包含很多“权威第三方”信息的证书
https://curl.haxx.se/ca/cacert.pem
2、将下载的 cacert.pem 证书放到 curl.exe 同级目录下
3、访问命令
curl -v --cacert cacert.pem https://www.baidu.com
参考链接:
【Linux学习笔记】探讨curl无法访问https网站的问题_shangke_sks的博客-CSDN博客_curl 无法访问https
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!