Why "SSL_CTX_load_verify_locations()" fails?

I am still trying to run the demo server and client but since
"SSL_CTX_load_verify_locations(..)" fails (returns 0) client and server
fail, either.


Can somebody tell me what I am doing wrong?


I created the root CA:

> openssl req -x509 -new -keyout root.pem -out root.pem -days 512

...and then created a certificate using root CA:

> openssl req -out careq.pem -new -keyout cacert.pem
> openssl x509 -req -in careq.pem -extensions v3_ca -CA root.pem
-CAcreateserial
-days 500 >> cacert.pem


Server uses the cacert.pem as certificate:

SSL_CTX_use_certificate_file(ctx, "cacert.pem", SSL_FILETYPE_PEM)


I copied the root.pem to the client so that it can authenticate the
certificate
send by server and used

SSL_CTX_load_verify_locations(ctx,"/mypath/root.pem",0)

in the client code.

Initially I was calling the function with a value "./" of CAfilepath
"SSL_CTX_load_verify_locations(ctx,"./",0)" and it was failing
immediately.
Now it spends some time (obviously doing something), but still fails.

I can verify the root.pem and cacert.pem using "openssl verify..."

So, what am I doing wrong?


Any help severe appreciated.

Thanks,
Tugrul




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

Reply via email to