I'm trying to use the SSL_CTX_use_PrivateKey_file function in OpenSSL under Linux, but it returns false. The surrounding code has been ported from Windows, where everything runs fine. Is there something that must be done differently depending on system?
I've compiled the OpenSSL library myself (default config etc) under Ubuntu and am using pre-compiled binaries for Windows (linked from the OpenSSL site).
The certificates are in .pem files as well as the key. Also, there's a password established.
The following is basically what's done;
SSL_CTX_set_default_passwd_cb( pContext, passwdCallback );
SSL_CTX_set_default_passwd_cb_userdata( pContext, (void*)this );
SSL_CTX_use_certificate_file( pContext, strCertificateFile, SSL_FILETYPE_PEM );
SSL_CTX_use_Privatekey_file( pContext, strPrivateKeyFile, SSL_FILETYPE_PEM ); // fail in Linux but work fine in Windows
Does anyone have an idea?