diff --git a/lib/base/application.cpp b/lib/base/application.cpp index 4707f0d23..ff806c3f3 100644 --- a/lib/base/application.cpp +++ b/lib/base/application.cpp @@ -14,6 +14,7 @@ #include "base/convert.hpp" #include "base/scriptglobal.hpp" #include "base/process.hpp" +#include "base/tlsutility.hpp" #include #include #include @@ -551,7 +552,8 @@ void Application::DisplayInfoMessage(std::ostream& os, bool skipVersion) os << "\nBuild information:\n" << " Compiler: " << systemNS->Get("BuildCompilerName") << " " << systemNS->Get("BuildCompilerVersion") << "\n" - << " Build host: " << systemNS->Get("BuildHostName") << "\n"; + << " Build host: " << systemNS->Get("BuildHostName") << "\n" + << " OpenSSL version: " << GetOpenSSLVersion() << "\n"; os << "\nApplication information:\n" << "\nGeneral paths:\n" diff --git a/lib/base/tlsutility.cpp b/lib/base/tlsutility.cpp index 7b8a6967f..ea3743dcb 100644 --- a/lib/base/tlsutility.cpp +++ b/lib/base/tlsutility.cpp @@ -8,6 +8,8 @@ #include "base/application.hpp" #include "base/exception.hpp" #include +#include +#include #include namespace icinga @@ -17,6 +19,15 @@ static bool l_SSLInitialized = false; static boost::mutex *l_Mutexes; static boost::mutex l_RandomMutex; +String GetOpenSSLVersion() +{ +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + return OpenSSL_version(OPENSSL_VERSION); +#else /* OPENSSL_VERSION_NUMBER >= 0x10100000L */ + return SSLeay_version(SSLEAY_VERSION); +#endif /* OPENSSL_VERSION_NUMBER >= 0x10100000L */ +} + #ifdef CRYPTO_LOCK static void OpenSSLLockingCallback(int mode, int type, const char *, int) { diff --git a/lib/base/tlsutility.hpp b/lib/base/tlsutility.hpp index 0f120aaf9..be93c7240 100644 --- a/lib/base/tlsutility.hpp +++ b/lib/base/tlsutility.hpp @@ -23,6 +23,8 @@ namespace icinga void InitializeOpenSSL(); +String GetOpenSSLVersion(); + Shared::Ptr MakeAsioSslContext(const String& pubkey = String(), const String& privkey = String(), const String& cakey = String()); void AddCRLToSSLContext(const Shared::Ptr& context, const String& crlPath); void SetCipherListToSSLContext(const Shared::Ptr& context, const String& cipherList);