diff options
author | Anthony Neal <aneal@zeroc.com> | 2002-02-01 14:54:27 +0000 |
---|---|---|
committer | Anthony Neal <aneal@zeroc.com> | 2002-02-01 14:54:27 +0000 |
commit | 2db07173ebd02856b8a82effdcd44f5db35ea3d5 (patch) | |
tree | 57caf536beeb64e0444a87bc1358c93aff1cabfe /cpp/src/Ice/SslSystemOpenSSL.cpp | |
parent | Updated to allow for overrides on certificates and keys. (diff) | |
download | ice-2db07173ebd02856b8a82effdcd44f5db35ea3d5.tar.bz2 ice-2db07173ebd02856b8a82effdcd44f5db35ea3d5.tar.xz ice-2db07173ebd02856b8a82effdcd44f5db35ea3d5.zip |
Updated to put proper exception in place for the byteSeqTo* routines.
Diffstat (limited to 'cpp/src/Ice/SslSystemOpenSSL.cpp')
-rw-r--r-- | cpp/src/Ice/SslSystemOpenSSL.cpp | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/cpp/src/Ice/SslSystemOpenSSL.cpp b/cpp/src/Ice/SslSystemOpenSSL.cpp index 27946d1eb9a..69c4a33f2e1 100644 --- a/cpp/src/Ice/SslSystemOpenSSL.cpp +++ b/cpp/src/Ice/SslSystemOpenSSL.cpp @@ -1156,7 +1156,23 @@ IceSecurity::Ssl::OpenSSL::System::byteSeqToX509(ByteSeq& byteSeq) if (!x509)
{
- cout << "X509 returned as NULL" << endl;
+ SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE, ERR_R_PEM_LIB);
+
+ ContextException contextEx(__FILE__, __LINE__);
+
+ contextEx._message = "Unable to load Public Key from memory buffer.";
+ string sslError = sslGetErrors();
+
+ if (!sslError.empty())
+ {
+ contextEx._message += "\n";
+ contextEx._message += sslError;
+ }
+
+
+ ICE_EXCEPTION(contextEx._message);
+
+ throw contextEx;
}
BIO_free(memoryBio);
@@ -1173,11 +1189,25 @@ IceSecurity::Ssl::OpenSSL::System::byteSeqToKey(ByteSeq& byteSeq) RSA* rsa = PEM_read_bio_RSAPrivateKey(memoryBio, 0, 0, 0);
- // TODO: if rsa comes back as 0, we should find out why here.
-
if (!rsa)
{
- cout << "RSA returned as NULL" << endl;
+ SSLerr(SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE, ERR_R_PEM_LIB);
+
+ ContextException contextEx(__FILE__, __LINE__);
+
+ contextEx._message = "Unable to load Private Key from memory buffer.";
+ string sslError = sslGetErrors();
+
+ if (!sslError.empty())
+ {
+ contextEx._message += "\n";
+ contextEx._message += sslError;
+ }
+
+
+ ICE_EXCEPTION(contextEx._message);
+
+ throw contextEx;
}
BIO_free(memoryBio);
|