cURL / Mailing Lists / curl-library / Single Mail


NSS, CURLOPT_CAINFO, and using the NSS CAs

From: David Shaw <>
Date: Thu, 24 Jul 2014 17:18:25 -0400


A good while back I had some code that needed to use the NSS CAs only (and not the PEM ca-bundle file). I did this by symlinking into my nssdb (so NSS would have the CA certs), and passing NULL for CURLOPT_CAINFO (so the PEM file wouldn't be loaded). This worked fine on libcurl 7.21.0 and NSS 3.12.10.

I'm trying to update this code to run on a more up to date system (RHEL7, which has libcurl 7.29.0 and NSS 3.15.4), but passing NULL for CURLOPT_CAINFO does not seem to work any longer. The NSS part seems correct, and "certutil -d /etc/pki/nssdb -L -h all" does in fact list all of the CAs. However, this sample program does not work:

#include <curl/curl.h>

int main(int argc, char *argv[])
  CURL *hnd;

  hnd = curl_easy_init();
  curl_easy_setopt(hnd, CURLOPT_URL, "");
  curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
  curl_easy_setopt(hnd, CURLOPT_CAINFO, NULL);



  return 0;

The error given is:

* Peer's Certificate issuer is not recognized.

This sample program does work on the older libcurl and NSS.

Any thoughts? Again, the intent here is to use the NSS CAs and ignore the ca-bundle.crt file.


List admin:
Received on 2014-07-24