Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding ssl certificates for the cCURL in android has errors
    primarykey
    data
    text
    <p>I have cross built the curl and openssl for the android with help of this link <a href="https://stackoverflow.com/questions/4952169/using-curl-in-android">Using cURL in Android</a> .. I am able to build succesfully . and now I am trying to run my application , in my application I need to add my own certificates , when I tried to add the <strong>certificates which are stored in sdcard via my native code</strong> ,I am getting the following error response from the curl i.e CURLE_SSL_CERTPROBLEM (58)=>problem with the local client certificate. and if remove all certificates in my below application and if I use the simple https curl client with out certificates get the following error CURLE_SSL_CACERT_BADFILE (77) .</p> <p>Here with I have put my code , and in that I am just trying to read the certificates from sdcard(I had copied and pasted in the sdcard) . </p> <p>am I loading the certificates properly ?</p> <p>//Inteface funciton that will recieve web page fom Java</p> <pre><code> { pageInfo_t page; CURL *curl; CURLcode res; char *buffer; static const char *pCertFile = "/mnt//sdcard/sslcerts/33330001-root.x509"; static const char *pCACertFile="/mnt//sdcard/sslcerts/root.x509.crt"; pKeyName = "/mnt/sdcard/sslcerts/33330001-root-privkey.der"; const char *pKeyName; const char *pKeyType; const char *pEngine; const jbyte *webpage; pKeyType = "DER"; pEngine = NULL; webpage = (*env)-&gt;GetStringUTFChars(env, webpageJStr, NULL); if (webpage == NULL) { return NULL; /* OutOfMemoryError already thrown */ } page.data = (char *)malloc(16 * 1024); page.len = 0; if (page.data) memset(page.data, 32, 16 * 1024); buffer = (char *)malloc(1024); curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, webpage); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, HTTPData); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &amp;page); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); curl_easy_setopt(curl,CURLOPT_SSLCERTTYPE,"DER"); curl_easy_setopt(curl,CURLOPT_SSLCERT,pCertFile); curl_easy_setopt(curl,CURLOPT_SSLKEYTYPE,pKeyType); curl_easy_setopt(curl,CURLOPT_SSLKEY,pKeyName); curl_easy_setopt(curl,CURLOPT_CAINFO,pCACertFile); curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,1L); res = curl_easy_perform(curl); /* always cleanup */ curl_easy_cleanup(curl); (*env)-&gt;ReleaseStringUTFChars(env, webpageJStr, webpage); if(res == 0) { if (buffer) { page.data[page.len &lt; 256 ? page.len : 256] = '\0'; sprintf(buffer, "pagedata(%d): %s. done.\n", page.len, page.data); return (*env)-&gt;NewStringUTF(env, buffer); } } sprintf(buffer, "Result %d", res); return (*env)-&gt;NewStringUTF(env, buffer); } else { return (*env)-&gt;NewStringUTF(env, "Unable to init cURL"); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload