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/SslConnectionOpenSSLClient.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/SslConnectionOpenSSLClient.cpp')
-rw-r--r-- | cpp/src/Ice/SslConnectionOpenSSLClient.cpp | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/cpp/src/Ice/SslConnectionOpenSSLClient.cpp b/cpp/src/Ice/SslConnectionOpenSSLClient.cpp index d4a7cf4e0dc..02b29b61012 100644 --- a/cpp/src/Ice/SslConnectionOpenSSLClient.cpp +++ b/cpp/src/Ice/SslConnectionOpenSSLClient.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/SslConnectionOpenSSLClient.h>
using IceSecurity::Ssl::ShutdownException;
@@ -172,24 +172,28 @@ IceSecurity::Ssl::OpenSSL::ClientConnection::init(int timeout) }
else // result == 0
{
+ 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.\n";
- 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__);
+
+ protocolEx._message = "Encountered a violation of the SSL Protocol during handshake.\n";
- ICE_SSLERRORS(errorString);
- ICE_EXCEPTION(errorString);
+ ICE_SSLERRORS(protocolEx._message);
+ ICE_EXCEPTION(protocolEx._message);
- throw ProtocolException(errorString.c_str(), __FILE__, __LINE__);
+ throw protocolEx;
}
}
@@ -382,13 +386,15 @@ IceSecurity::Ssl::OpenSSL::ClientConnection::write(Buffer& buf, int timeout) }
else if (bytesWritten > 0)
{
+ 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.\n";
- ICE_SSLERRORS(errorString);
- ICE_EXCEPTION(errorString);
+ ICE_SSLERRORS(protocolEx._message);
+ ICE_EXCEPTION(protocolEx._message);
- throw ProtocolException(errorString.c_str(), __FILE__, __LINE__);
+ throw protocolEx;
}
else // bytesWritten == 0
{
@@ -402,12 +408,14 @@ IceSecurity::Ssl::OpenSSL::ClientConnection::write(Buffer& buf, int timeout) 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.\n";
- 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:
|