P
P
Push Pull2014-04-18 16:17:52
C++ / C#
Push Pull, 2014-04-18 16:17:52

libcrul and https?

I'm fighting for life and death for the right to request an https server using libcurl (i.e. "c").
In si, I am obviously weak, only a small experience from the university.
Bottom line: I'm trying to make a request to the https server using libcurl.
There is a php script that works perfectly, doing what it intended. However, you need speed.
php curl
options CURLE_FTP_SSL_FAILED: 0
CURLOPT_SSL_VERIFYHOST: 0
CURLOPT_SSLVERSION: 3
CURLOPT_SSL_CIPHER_LIST: "RC4-SHA"
CURLOPT_CAINFO: "path to the keyed certificate"
CURLOPT_SSLCERT: "path to the certificate"
CURLOPT_HTTPHEADER: "content-Type" -8"
curl options to "c"

curl_easy_setopt(curl, CURLOPT_URL, "https:url");
curl_easy_setopt(curl, CURLOPT_HEADER, "Content-Type: text/xml; charset=UTF-8");      
curl_easy_setopt(curl,CURLOPT_SSLCERTTYPE,"PEM");
curl_easy_setopt(curl,CURLOPT_SSLCERT, "путь к сертификату склееного с ключом");

curl_easy_setopt(curl, CURLOPT_CAINFO,  "путь к сертификату");
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER , 0);
curl_easy_setopt(curl, CURLOPT_SSL_CIPHER_LIST, "RC4-SHA");
curl_easy_setopt(curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_SSLv3);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);

The only trouble is that the php code works, but not in C, or segfalt or CURLE_SSL_CERTPROBLEM (58) or CURLE_SSL_CACERT (60), but I doubt that the problem is with certificates, because. they work fine in php case.
And can someone explain why for php curl it was necessary to add a certificate file glued with a key to the request? I just can’t have a more capacious description for CURLOPT_CAINFO and CURLOPT_SSLCERT than on curl.haxx.se/libcurl/c/curl_easy_setopt.html
I’m not friends with https either. so it might look stupid.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Sundukov, 2014-04-18
@alekciy

curl in this task will not give performance.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question