I have written a server and client using the openSSL api
for security. And my problem comes when i want to verify the certificate
at the client side.
This function verifies the the certificate, and the function returns
berr_exit("Certificate doesn't verify");
with the error message showed.
But I don't know why the certificate does'nt verify.
On the server I use the certificate & private key that i created with
the openssl command tool.
the code for using the certifcate is:
the certificate was created like this
// set the locale certificate from cerfile
if (SSL_CTX_use_certificate_file(ctx, certfile, SSL_FILETYPE_PEM) <= 0)
fprintf(stderr, "error cert\n");
// set the private key from keyfile
if (SSL_CTX_use_PrivateKey_file(ctx, keyfile, SSL_FILETYPE_PEM) <= 0)
fprintf(stderr, "error key\n");
// verify private key
fprintf(stderr, "Private key does not math the public certificate\n");
// private key
openssl genrsa -des3 -out server.key 1024
openssl req -new -days 365 -key server.key -out server.csr
openssl genrsa -des3 -out ca.key 1024
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
i dont know where the error can be.
anyone have any ideas?
try the server side, make sure they both have the same formats. see if you can isolate the exact area of the code it is on. Look for examples on the web similar to your code