diff options
author | Anthony Neal <aneal@zeroc.com> | 2001-11-19 16:57:26 +0000 |
---|---|---|
committer | Anthony Neal <aneal@zeroc.com> | 2001-11-19 16:57:26 +0000 |
commit | 49f62a02524a98b8bd1c40cfd2c3f96d8070aeb5 (patch) | |
tree | 57959cf59c2e4c7e45449a63a5a8362cd3bbb05c /cpp/src/Ice/SslConnectionOpenSSLServer.cpp | |
parent | Fixed some bugs regarding exception message reporting. (diff) | |
download | ice-49f62a02524a98b8bd1c40cfd2c3f96d8070aeb5.tar.bz2 ice-49f62a02524a98b8bd1c40cfd2c3f96d8070aeb5.tar.xz ice-49f62a02524a98b8bd1c40cfd2c3f96d8070aeb5.zip |
Now Ssl (Security) exceptions are genereated from slice.
Diffstat (limited to 'cpp/src/Ice/SslConnectionOpenSSLServer.cpp')
-rw-r--r-- | cpp/src/Ice/SslConnectionOpenSSLServer.cpp | 60 |
1 files changed, 36 insertions, 24 deletions
diff --git a/cpp/src/Ice/SslConnectionOpenSSLServer.cpp b/cpp/src/Ice/SslConnectionOpenSSLServer.cpp index 5df3ad1facd..772f2587d00 100644 --- a/cpp/src/Ice/SslConnectionOpenSSLServer.cpp +++ b/cpp/src/Ice/SslConnectionOpenSSLServer.cpp @@ -12,7 +12,7 @@ #include <sstream>
#include <Ice/Network.h>
#include <Ice/Security.h>
-#include <Ice/SslException.h>
+#include <Ice/SecurityException.h>
#include <Ice/SslConnectionOpenSSLServer.h>
using IceSecurity::Ssl::CertificateException;
@@ -125,20 +125,24 @@ IceSecurity::Ssl::OpenSSL::ServerConnection::init(int timeout) if (verify_error != X509_V_OK)
{
- string errorString = "SSL certificate verification error.";
+ CertificateException certEx(__FILE__, __LINE__);
- ICE_EXCEPTION(errorString);
+ certEx._message = "SSL certificate verification error.";
- throw CertificateException(errorString.c_str(), __FILE__, __LINE__);
+ ICE_EXCEPTION(certEx._message);
+
+ throw certEx;
}
else
{
- string errorString = "Encountered an SSL Protocol violation during handshake.";
+ ProtocolException protocolEx(__FILE__, __LINE__);
+
+ protocolEx._message = "Encountered an SSL Protocol violation during handshake.";
- ICE_SSLERRORS(errorString);
- ICE_EXCEPTION(errorString);
+ ICE_SSLERRORS(protocolEx._message);
+ ICE_EXCEPTION(protocolEx._message);
- throw ProtocolException(errorString.c_str(), __FILE__, __LINE__);
+ throw protocolEx;
}
}
@@ -198,24 +202,28 @@ IceSecurity::Ssl::OpenSSL::ServerConnection::init(int timeout) }
else
{
+ ProtocolException protocolEx(__FILE__, __LINE__);
+
// Protocol Error: Unexpected EOF
- string errorString = "Encountered an EOF during handshake that violates the SSL Protocol.\n";
+ protocolEx._message = "Encountered an EOF during handshake that violates the SSL Protocol.";
- ICE_SSLERRORS(errorString);
- ICE_EXCEPTION(errorString);
+ ICE_SSLERRORS(protocolEx._message);
+ ICE_EXCEPTION(protocolEx._message);
- throw ProtocolException(errorString.c_str(), __FILE__, __LINE__);
+ throw protocolEx;
}
}
case SSL_ERROR_SSL:
{
- string errorString = "Encountered a violation of the SSL Protocol during handshake.\n";
+ ProtocolException protocolEx(__FILE__, __LINE__);
- ICE_SSLERRORS(errorString);
- ICE_EXCEPTION(errorString);
+ protocolEx._message = "Encountered a violation of the SSL Protocol during handshake.";
- throw ProtocolException(errorString.c_str(), __FILE__, __LINE__);
+ ICE_SSLERRORS(protocolEx._message);
+ ICE_EXCEPTION(protocolEx._message);
+
+ throw protocolEx;
}
}
@@ -376,24 +384,28 @@ IceSecurity::Ssl::OpenSSL::ServerConnection::write(Buffer& buf, int timeout) }
else
{
+ ProtocolException protocolEx(__FILE__, __LINE__);
+
// Protocol Error: Unexpected EOF
- string errorString = "Encountered an EOF that violates the SSL Protocol.\n";
+ protocolEx._message = "Encountered an EOF that violates the SSL Protocol.";
- ICE_SSLERRORS(errorString);
- ICE_EXCEPTION(errorString);
+ ICE_SSLERRORS(protocolEx._message);
+ ICE_EXCEPTION(protocolEx._message);
- throw ProtocolException(errorString.c_str(), __FILE__, __LINE__);
+ throw protocolEx;
}
}
case SSL_ERROR_SSL:
{
- string errorString = "Encountered a violation of the SSL Protocol.\n";
+ ProtocolException protocolEx(__FILE__, __LINE__);
+
+ protocolEx._message = "Encountered a violation of the SSL Protocol.";
- ICE_SSLERRORS(errorString);
- ICE_EXCEPTION(errorString);
+ ICE_SSLERRORS(protocolEx._message);
+ ICE_EXCEPTION(protocolEx._message);
- throw ProtocolException(errorString.c_str(), __FILE__, __LINE__);
+ throw protocolEx;
}
case SSL_ERROR_ZERO_RETURN:
|