Home > Back-end >  C using libcurl post request, everything is ok on Windows, on xp CURLE_SSL_CONNECT_ERROR error, skip
C using libcurl post request, everything is ok on Windows, on xp CURLE_SSL_CONNECT_ERROR error, skip

Time:11-08

The curl=curl_easy_init ();
If (curl)
{
//remote URL, support HTTP, HTTPS, FTP
Curl_easy_setopt (curl, CURLOPT_URL, strURL c_str ());
Curl_easy_setopt (curl, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT6.0) ");
//the official download a DLL doesn't support GZIP, Accept - Encoding: deflate, GZIP
//curl_easy_setopt (curl, CURLOPT_ENCODING, "gzip, deflate");
Curl_easy_setopt (curl, CURLOPT_VERBOSE, 1 l);//debugging information open
//HTTPS access dedicated: start
Curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 0);
Curl_easy_setopt (curl, CURLOPT_SSL_VERIFYHOST, 0);

//sets the content type at the HTTP send JSON
Curl_slist * slist=curl_slist_append (NULL,
"The content-type: application/json");
If (strContentType=="json")
Curl_easy_setopt (curl, CURLOPT_HTTPHEADER, slist);


Curl_easy_setopt (curl, CURLOPT_HTTPAUTH CURLAUTH_ANY);
/* */POST data
Curl_easy_setopt (curl, CURLOPT_POSTFIELDS, strPostData c_str ());
Curl_easy_setopt (curl, CURLOPT_POST, true);
//set the redirect the maximum times
Curl_easy_setopt (curl, CURLOPT_MAXREDIRS, 5);
//set 301302 jump follow the location
Curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1);
//grab headers, the callback function
Curl_easy_setopt (curl, CURLOPT_HEADERFUNCTION callback_header_func);
Curl_easy_setopt (curl, CURLOPT_HEADERDATA, & amp; M_strHeaderData);
//scraping content, the callback function
Curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION callback_wirte_func);
Curl_easy_setopt (curl, CURLOPT_WRITEDATA, & amp; M_strWriteData);
Curl_easy_setopt (curl, CURLOPT_VERBOSE, 1);
CURLcode code=curl_easy_perform (curl);
If (CURLE_OK==code)
{
Code=curl_easy_getinfo (curl, CURLINFO_RESPONSE_CODE, & amp; LRet);
If (CURLE_OK==code & amp; & LRet==200)
{
StrRet=m_strWriteData;
}
}
The else {
}
//release the memory
Curl_slist_free_all (slist);/* free the list again */
Curl_easy_cleanup (curl);
}

CodePudding user response:

No one pay attention to?

CodePudding user response:

SSL connection error, that run on the system did not support HTTPS/SSL DLLs, install the IIS or Apache web server software has built-in IIS on the high version of Windows, so you can run normal

CodePudding user response:

refer to the second floor early play big play nuclear response:
SSL connection error, on the operation of the system did not support HTTPS/SSL DLLs, install the IIS or Apache web server software has built-in IIS on the high version of Windows, so you can run normal


I have installed the iis on XP, but the request data, is still the same error...
  • Related