Hi Amar,
Inserting absolute path name for the CA cert did the trick.
thanks!
Ashu
Amar Desai wrote:
>
> Hi
>
>> 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"
>>
>
> Is "cacert.pem" is in your current directory? Have you tried absolute
> path for file as well? And last thing does you file "cacert.pem "
> contains atleast one good certificate?
>
> I hope this will help you.
>
> Regards
> Amar
>
>
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]