我试图下载使用ssl的网页。我已登录该页面,但由于srange错误导致我的页面空白。
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CAPATH, "a.crt");
curl_easy_setopt(curl, CURLOPT_CAINFO, "a.crt");
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(curl, CURLOPT_URL, "https://example.org");
curl_easy_setopt(curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_DEFAULT);
res = curl_easy_perform(curl);
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
curl_easy_cleanup(curl);
}
cout << res;
我的输出结果是:
* Trying xxx.xxx.xxx.xxx...
* Connected to example.org (xxx.xxx.xxx.xxx) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: a.crt
CApath: a.crt
* Unknown SSL protocol error in connection to example.org:443
* Closing connection 0
curl_easy_perform() failed: SSL connect error
35
我无法理解为什么 谢谢