【发布时间】:2020-11-10 08:39:38
【问题描述】:
我在使用 curl 进行 URL 调用时遇到了问题。
首先在curl 7.40.0版本中声明curl.h文件
#include "curl.h" // curl-7.40.0
在调用 curl 的函数中...
CURL *curl = curl_easy_init();
CURLcode res;
curl_easy_setopt(curl, CURLOPT_URL,"https://www.google.com");
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, TURE);
res = curl_easy_perform(curl);
执行上述代码时,出现如下错误
- 将 URL 重建为:https://www.google.com/
- libcurl 中不支持或禁用协议“https”
- 关闭连接 -1
同样,当我在 Linux 控制台中使用 curl 命令运行它时,它运行正常。 (卷曲版本 7.19.7)
curl https://www.google.com
你能告诉我有什么问题吗?
谢谢!
【问题讨论】:
-
这能解决你的问题吗OP