Allow caller to disable SSL Initialization, so it can be done outside of Poco.

This commit is contained in:
bobstabler
2015-04-30 16:37:21 -05:00
parent b565d72d4c
commit 6ccfaa53d0
2 changed files with 39 additions and 20 deletions

View File

@@ -44,7 +44,7 @@ namespace Crypto {
class Crypto_API OpenSSLInitializer
/// Initializes the OpenSSL library.
/// Initalizes the OpenSSL library.
///
/// The class ensures the earliest initialization and the
/// latest shutdown of the OpenSSL library.
@@ -68,6 +68,8 @@ public:
static void enableFIPSMode(bool enabled);
// Enable or disable FIPS mode. If FIPS is not available, this method doesn't do anything.
static void disableSSLInitialization(); // Call if OpenSSL is already being initialized by another component before constructing any OpenSSLInitializers.
protected:
enum
{
@@ -84,6 +86,8 @@ protected:
private:
static Poco::FastMutex* _mutexes;
static Poco::AtomicCounter _rc;
static bool _disableSSLInitialization;
static bool _setupMultiThreadSupport;
};
@@ -110,6 +114,11 @@ inline void OpenSSLInitializer::enableFIPSMode(bool /*enabled*/)
}
#endif
inline void OpenSSLInitializer::disableSSLInitialization()
{
_disableSSLInitialization = true;
}
} } // namespace Poco::Crypto