Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The very first thing I notice, you're doing: </p> <pre><code>rv=curl_easy_setopt (ch, CURLOPT_CAPATH, "./cacert.pem" ); </code></pre> <p>needs to specify a "string naming a directory holding multiple CA certificates to verify the peer with". From the man page. You'll probably want <code>"/etc/tls/certs/"</code></p> <p>In addition, it would appear the line:</p> <pre><code>rv=curl_easy_setopt(ch,CURLOPT_SSL_CTX_FUNCTION, *sslctx_function); </code></pre> <p>is doing nothing. I say this because, again, from the man page, "This option does only function for libcurl powered by OpenSSL". I say this because, your error log has "NSS error"</p> <p>My experience with working with ssl is only with openssl. I found the command line function <code>openssl s_client</code> to be helpful. That being said, it is very easy to miss configure your setup. Many functions and command line options will try to work with even the craziest input, leading to red herring errors.</p> <p><strong>Edit:</strong> My attempt at your program completes with success.</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;curl/curl.h&gt; int main(void) { CURL * ch; CURLcode rv; rv=curl_global_init(CURL_GLOBAL_ALL); ch=curl_easy_init(); rv=curl_easy_setopt(ch, CURLOPT_VERBOSE, 1L); rv=curl_easy_setopt(ch, CURLOPT_CAPATH, "/etc/ssl/certs"); rv=curl_easy_setopt(ch, CURLOPT_URL, "https://"); rv=curl_easy_perform(ch); if (rv==CURLE_OK) { printf("*** transfer succeeded ***\n"); } else { printf("*** transfer failed ***\n"); } curl_easy_cleanup(ch); curl_global_cleanup(); return rv; } </code></pre>
    singulars
    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.
    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