version 1.4, 2002/08/06 21:28:35
|
version 1.5, 2002/08/16 01:28:06
|
|
|
VERIFY_CERTIFICATE verifyCert, | VERIFY_CERTIFICATE verifyCert, |
const String& randomFile, | const String& randomFile, |
Boolean isCIMClient) | Boolean isCIMClient) |
throw(SSL_Exception) |
throw(SSLException) |
{ | { |
PEG_METHOD_ENTER(TRC_SSL, "SSLContextRep::SSLContextRep()"); | PEG_METHOD_ENTER(TRC_SSL, "SSLContextRep::SSLContextRep()"); |
| |
|
|
if ( ret < 0 ) | if ( ret < 0 ) |
{ | { |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
throw( SSL_Exception("RAND_load_file - failed")); |
throw( SSLException("RAND_load_file - failed")); |
} | } |
| |
// | // |
|
|
PEG_TRACE_STRING(TRC_SSL, Tracer::LEVEL4, | PEG_TRACE_STRING(TRC_SSL, Tracer::LEVEL4, |
"Not enough data , RAND_status = " + seedRet ); | "Not enough data , RAND_status = " + seedRet ); |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
throw( SSL_Exception("RAND_seed - Not enough seed data ")); |
throw( SSLException("RAND_seed - Not enough seed data ")); |
} | } |
} | } |
else | else |
{ | { |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
throw( SSL_Exception("Random seed file required")); |
throw( SSLException("Random seed file required")); |
} | } |
| |
} | } |
|
|
if (!( _SSLContext = SSL_CTX_new(SSLv23_method()) )) | if (!( _SSLContext = SSL_CTX_new(SSLv23_method()) )) |
{ | { |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
throw( SSL_Exception("Could not get SSL CTX")); |
throw( SSLException("Could not get SSL CTX")); |
} | } |
| |
#ifdef PEGASUS_OS_HPUX | #ifdef PEGASUS_OS_HPUX |
if (!(SSL_CTX_set_cipher_list(_SSLContext, SSL_TXT_EXP40))) | if (!(SSL_CTX_set_cipher_list(_SSLContext, SSL_TXT_EXP40))) |
throw( SSL_Exception("Could not set the cipher list")); |
throw( SSLException("Could not set the cipher list")); |
#endif | #endif |
| |
// | // |
|
|
if (!cert_verify(_SSLContext, _certPath, _certPath)) | if (!cert_verify(_SSLContext, _certPath, _certPath)) |
{ | { |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
throw( SSL_Exception("Could not get certificate and/or private key")); |
throw( SSLException("Could not get certificate and/or private key")); |
} | } |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
|
|
SSLContextRep::SSLContextRep(const String& certPath, | SSLContextRep::SSLContextRep(const String& certPath, |
VERIFY_CERTIFICATE verifyCert, | VERIFY_CERTIFICATE verifyCert, |
const String& randomFile, | const String& randomFile, |
Boolean isCIMClient) throw(SSL_Exception) {} |
Boolean isCIMClient) throw(SSLException) {} |
| |
SSLContextRep::~SSLContextRep() {} | SSLContextRep::~SSLContextRep() {} |
| |
|
|
const String& certPath, | const String& certPath, |
VERIFY_CERTIFICATE verifyCert, | VERIFY_CERTIFICATE verifyCert, |
const String& randomFile, | const String& randomFile, |
Boolean isCIMClient) throw(SSL_Exception) |
Boolean isCIMClient) throw(SSLException) |
{ | { |
_rep = new SSLContextRep(certPath, verifyCert, randomFile, isCIMClient); | _rep = new SSLContextRep(certPath, verifyCert, randomFile, isCIMClient); |
} | } |