fix(SSLManager): Race condition in SSLManager #3558

This commit is contained in:
Alex Fabijanic 2022-04-16 21:49:49 +02:00
parent 7b051851b6
commit fa6e3f5e9d

View File

@ -119,6 +119,7 @@ SSLManager& SSLManager::instance()
void SSLManager::initializeServer(PrivateKeyPassphraseHandlerPtr ptrPassphraseHandler, InvalidCertificateHandlerPtr ptrHandler, Context::Ptr ptrContext)
{
Poco::FastMutex::ScopedLock lock(_mutex);
_ptrServerPassphraseHandler = ptrPassphraseHandler;
_ptrServerCertificateHandler = ptrHandler;
_ptrDefaultServerContext = ptrContext;
@ -127,6 +128,7 @@ void SSLManager::initializeServer(PrivateKeyPassphraseHandlerPtr ptrPassphraseHa
void SSLManager::initializeClient(PrivateKeyPassphraseHandlerPtr ptrPassphraseHandler, InvalidCertificateHandlerPtr ptrHandler, Context::Ptr ptrContext)
{
Poco::FastMutex::ScopedLock lock(_mutex);
_ptrClientPassphraseHandler = ptrPassphraseHandler;
_ptrClientCertificateHandler = ptrHandler;
_ptrDefaultClientContext = ptrContext;