mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-28 19:51:58 +01:00
Allow caller to disable SSL Initialization, so it can be done outside of Poco.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user