Good evening,
I need to implement libCurl into one of our Android projects. I use JNI to call the c++ class with the libCurl code. Everything works just perfect but for the love of god I can't get it to work using a https url. I always get the CURLE_UNSUPPORTED_PROTOCOL error.
I'm using this prebuild curl library with SSL
My c++ code looks like this:
curl_easy_setopt(curl, CURLOPT_URL, "https://www.es....");
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&chunk);
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);
curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, (void *)&cbProgress);
curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_func);
curl_easy_setopt(curl, CURLOPT_SSLVERSION, 3);
status = curl_easy_perform(curl);
I use the same code for iOS and it works fine with https. Again, using a http url works just fine.
Any help is truly appreciated !!
From libcurl errors manpage:
The
compile-time option
is the important takeaway of this. So, test the library that you're using withcurl_version_info()
(manpage here) to see if it containsSSL
support or not. The library doc may say it hasSSL
support, but please confirm. If it doesn't containSSL
support, then nohttps
.You need compile libcurl.so with "--with-ssl"
Which is really suffering. Refer "http://ieroot.com/2015/03/29/1728.html", may help you .