Open
Description
Curl 请求 Https
使用 curl 发送 https 请求时,如下命令就会报错:
curl "https://www.baidu.com"
错误代码:
<div style="background:black;font:conloas;color:white;">
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html
</div>
一般的解决办法就是下载CA证书。但是使用C++代码调用 libcurl
发送 https 请求,只需要在设置一下这个就可以关闭 ssl 验证,从而能够发送 https 请求。
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, false);
blog link Curl 请求 Https