Hi,
I'm trying to load the CA certificate and create a store using the
X509_STORE_load_locations() function, but the function seems to fail. I
am using absolute path of the CA directory as an argument, which is
different from the /etc/ssl/certs location. Is it necessary to put the
CA certs in the /etc/ssl/certs location? Here's the code:

  X509_STORE *store;
  X509_LOOKUP *lookup;

  /* create the cert store and set the verify callback */
  if (!(store = X509_STORE_new ())){
      fprintf (stderr, "Error creating X509_STORE_CTX object\n");
      goto err1;
    }

  X509_STORE_set_verify_cb_func (store, VerifyCallback);

  if (!X509_STORE_load_locations(store, CA_FILE, CA_DIR)){
      fprintf (stderr, "Error loading the CA file or directory\n");
      goto err1;
    }

where

#define CA_FILE "cacert.pem"
#define CA_DIR "/docs/openssl/CA/certs"


I would appreciate any comments.

thanks,
Ashu

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to