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

posted @   散人长情  阅读(1272)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!
点击右上角即可分享
微信分享提示