diff options
author | Chris Wilson <chris+github@qwirx.com> | 2012-04-28 18:11:21 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2012-04-28 18:11:21 +0000 |
commit | 9261f88d923cff5307de4d5465fe9f72f45ccd0a (patch) | |
tree | 9dc850a5447eecdda7fb780bd962d8198d391bf6 /lib/server/SSLLib.cpp | |
parent | fcc32a449e27447f0d231a87325db4b3358f6767 (diff) |
Move LogError out of server/SSLLib so we can use it in Crypto.
Diffstat (limited to 'lib/server/SSLLib.cpp')
-rw-r--r-- | lib/server/SSLLib.cpp | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/lib/server/SSLLib.cpp b/lib/server/SSLLib.cpp index de7a941b..004d2d98 100644 --- a/lib/server/SSLLib.cpp +++ b/lib/server/SSLLib.cpp @@ -18,6 +18,7 @@ #include <wincrypt.h> #endif +#include "CryptoUtils.h" #include "SSLLib.h" #include "ServerException.h" @@ -39,8 +40,9 @@ void SSLLib::Initialise() { if(!::SSL_library_init()) { - LogError("initialising OpenSSL"); - THROW_EXCEPTION(ServerException, SSLLibraryInitialisationError) + THROW_EXCEPTION_MESSAGE(ServerException, + SSLLibraryInitialisationError, + CryptoUtils::LogError("initialising OpenSSL")); } // More helpful error messages @@ -89,23 +91,3 @@ void SSLLib::Initialise() } -// -------------------------------------------------------------------------- -// -// Function -// Name: SSLLib::LogError(const char *) -// Purpose: Logs an error -// Created: 2003/08/06 -// -// -------------------------------------------------------------------------- -void SSLLib::LogError(const std::string& rErrorDuringAction) -{ - unsigned long errcode; - char errname[256]; // SSL docs say at least 120 bytes - while((errcode = ERR_get_error()) != 0) - { - ::ERR_error_string_n(errcode, errname, sizeof(errname)); - BOX_ERROR("SSL error while " << rErrorDuringAction << ": " << - errname); - } -} - |