dear all:

by using the following openssl cli, i generate a rsa private key key and a self 
signed certificate file.

$ openssl genrsa -out key.pem 1024
$ openssl req -new -key key.pem -out request.pem
$ openssl x509 -req -days 30 -in request.pem -signkey key.pem -out 
certificate.pem

when i try to load the key file and certificate file to my ssl context, both 
SSL_CTX_use_certificate_file(ctx,keyfile,SSL_FILETYPE_PEM) and
SSL_CTX_use_PrivateKey_file(ctx,keyfile,SSL_FILETYPE_PEM)
returns 1. 

however, when i use
SSL_CTX_check_private_key(ctx)
to check if the key matchs the certificate, this function returns 0.

what could be wrong here? it seems these are all standard simple operations.
thanks a lot.

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

Reply via email to