diff options
Diffstat (limited to 'cpp/src/Ice/SslConnectionOpenSSLClient.cpp')
-rw-r--r-- | cpp/src/Ice/SslConnectionOpenSSLClient.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/cpp/src/Ice/SslConnectionOpenSSLClient.cpp b/cpp/src/Ice/SslConnectionOpenSSLClient.cpp index b07b9566b71..9519309ece5 100644 --- a/cpp/src/Ice/SslConnectionOpenSSLClient.cpp +++ b/cpp/src/Ice/SslConnectionOpenSSLClient.cpp @@ -13,7 +13,7 @@ #include <Ice/OpenSSLUtils.h> #include <Ice/Network.h> #include <Ice/OpenSSL.h> -#include <Ice/SslException.h>
+#include <Ice/SslException.h> #include <Ice/OpenSSLJanitors.h> #include <Ice/SslConnectionOpenSSLClient.h> @@ -170,39 +170,39 @@ IceSSL::OpenSSL::ClientConnection::init(int timeout) protocolEx._message = "encountered an EOF during handshake that violates the ssl protocol\n"; protocolEx._message += sslGetErrors(); - throw protocolEx;
+ throw protocolEx; } } case SSL_ERROR_SSL: { - int verifyError = SSL_get_verify_result(_sslConnection);
-
- if (verifyError != X509_V_OK && verifyError != 1)
- {
- CertificateVerificationException certVerEx(__FILE__, __LINE__);
-
- certVerEx._message = "ssl certificate verification error";
-
- string errors = sslGetErrors();
-
- if (!errors.empty())
- {
- certVerEx._message += "\n";
- certVerEx._message += errors;
- }
-
- throw certVerEx;
- }
- else
- {
+ int verifyError = SSL_get_verify_result(_sslConnection); + + if (verifyError != X509_V_OK && verifyError != 1) + { + CertificateVerificationException certVerEx(__FILE__, __LINE__); + + certVerEx._message = "ssl certificate verification error"; + + string errors = sslGetErrors(); + + if (!errors.empty()) + { + certVerEx._message += "\n"; + certVerEx._message += errors; + } + + throw certVerEx; + } + else + { ProtocolException protocolEx(__FILE__, __LINE__); protocolEx._message = "encountered a violation of the ssl protocol during handshake\n"; protocolEx._message += sslGetErrors(); throw protocolEx; - }
+ } } } @@ -294,8 +294,8 @@ IceSSL::OpenSSL::ClientConnection::write(Buffer& buf, int timeout) case SSL_ERROR_SYSCALL: { - // NOTE: The OpenSSL demo client only raises and error condition if there were
- // actually bytes written. This is considered to be an error status
+ // NOTE: The OpenSSL demo client only raises and error condition if there were + // actually bytes written. This is considered to be an error status // requiring shutdown. // If nothing was written, the demo client stops writing - we continue. // This is potentially something wierd to watch out for. @@ -374,7 +374,7 @@ IceSSL::OpenSSL::ClientConnection::showConnectionInfo() { // Only in extreme cases do we enable this, partially because it doesn't use the Logger. if ((_traceLevels->security >= IceSSL::SECURITY_PROTOCOL_DEBUG) && 0) - {
+ { BIOJanitor bioJanitor(BIO_new_fp(stdout, BIO_NOCLOSE)); BIO* bio = bioJanitor.get(); |