Note that there are some explanatory texts on larger screens.

plurals
  1. POlib cCURL with https throws error
    primarykey
    data
    text
    <p>I have written C curl application code to test my server TLS connection using my own certificates and own server setup with AES-ECC-CCM chiper suite . but I got the error at the client side as curl unable to load the given chiper suite . hence here with I put my code.. am I following the correct way to select the chiper suite at the client side ..?and code is correct ..?</p> <pre><code>CURL *curl; CURLcode res; FILE *headerfile; const char *pPassphrase = NULL; static const char *pCertFile = "/root/rev/mysert.der"; static const char *pCACertFile="/root/rev/cacert.der"; const char *pKeyName; const char *pKeyType; const char *pEngine; pKeyName = "/root/rev/testkey.der"; pKeyType = "DER"; headerfile = fopen("dumpit", "w"); curl_global_init(CURL_GLOBAL_DEFAULT); curl = curl_easy_init(); if(curl) { /* what call to write: */ curl_easy_setopt(curl, CURLOPT_URL, "https://192.168.1.121/test"); curl_easy_setopt(curl, CURLOPT_WRITEHEADER, headerfile); while(1) /* do some ugly short cut... */ { /*SET THE CIPHER TO ECC-CCM */ **curl_easy_setopt(curl,CURLOPT_SSL_CIPHER_LIST,"TLS_ECDHE_ECDSA_WITH_AES_128_CCM");** curl_easy_setopt(curl,CURLOPT_SSLCERTTYPE,"DER"); /* set the cert for client authentication */ curl_easy_setopt(curl,CURLOPT_SSLCERT,pCertFile); /* sorry, for engine we must set the passphrase (if the key has one...) */ if (pPassphrase) curl_easy_setopt(curl,CURLOPT_KEYPASSWD,pPassphrase); /* if we use a key stored in a crypto engine, we must set the key type to "ENG" */ curl_easy_setopt(curl,CURLOPT_SSLKEYTYPE,pKeyType); /* set the private key (file or ID in engine) */ curl_easy_setopt(curl,CURLOPT_SSLKEY,pKeyName); /* set the file with the certs vaildating the server */ curl_easy_setopt(curl,CURLOPT_CAINFO,pCACertFile); /* disconnect if we can't validate server's cert */ curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,1L); /* Perform the request, res will get the return code */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); break; /* we are done... */ } /* always cleanup */ curl_easy_cleanup(curl); } curl_global_cleanup(); </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    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