SSL_CTX_use_PrivateKey_file() seems to fail for me.  I am reasonably new to this.  Is there any kind of error stack or description that I can look at?

If it makes a difference, I have gotten a class 3 certificate from verisign, and I believe that it is in PEM format. 

Any help would be appreciated.  I have included a section of the code that I am using below:

 
  meth = SSLv3_client_method();
  myCTX = SSL_CTX_new( meth );

  if( SSL_CTX_use_certificate_file( myCTX, CertPEM, X509_FILETYPE_PEM ) <= 0 ) {
   m_DebugLog.lfputs( "Failure: SSL_CTX_use_certificate_file( \"%s\")", CertPEM );
   _socket = INVALID_SOCKET;
   goto Error;
  }else {
   m_DebugLog.lfputs( "Success: SSL_CTX_use_certificate_file()" );
  }
 
  if( !SSL_CTX_use_PrivateKey_file( myCTX, CertPEM, X509_FILETYPE_PEM ) ) {
   m_DebugLog.lfputs( "Failure: SSL_CTX_use_PrivateKey_file()" );
   _socket = INVALID_SOCKET;
   goto Error;
  }else {
   m_DebugLog.lfputs( "Success: SSL_CTX_use_PrivateKey_file()" );
  }
 
Thanks,
Chris

Reply via email to