当我运行此代码时,我收到错误信息:
CURL *卷曲; CURLcode res;
//static const char *pClientCert = "/home/wh/work/sslkey/user1.pem";
curl_global_init(CURL_GLOBAL_DEFAULT);
curl = curl_easy_init();
if(curl)
{
curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(curl, CURLOPT_URL, "https://10.12.190.155/");
curl_easy_setopt(curl, CURLOPT_CAINFO, "/home/wh/work/sslkey/ca.crt");
curl_easy_setopt(curl,CURLOPT_SSLCERT,"/home/wh/work/sslkey/user1.pem");
res = curl_easy_perform(curl);
/* Check for errors */
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
curl_easy_strerror(res));
curl_easy_cleanup(curl);
}
curl_global_cleanup();