diff options
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:
|