(openssl tls) when OpenSSL is older than 1.1, register the crypto locking callback to be thread safe. Should fix lots of CI failures

This commit is contained in:
Benjamin Sergeant
2020-05-06 16:26:30 -07:00
parent a65b334961
commit 6c205b983e
8 changed files with 34 additions and 5 deletions

View File

@ -49,6 +49,12 @@ namespace ix
bool handleTLSOptions(std::string& errMsg);
bool openSSLServerHandshake(std::string& errMsg);
// Required for OpenSSL < 1.1
void openSSLLockingCallback(int mode,
int type,
const char* /*file*/,
int /*line*/);
SSL* _ssl_connection;
SSL_CTX* _ssl_context;
const SSL_METHOD* _ssl_method;
@ -58,6 +64,7 @@ namespace ix
static std::once_flag _openSSLInitFlag;
static std::atomic<bool> _openSSLInitializationSuccessful;
static std::unique_ptr<std::mutex[]> _openSSLMutexes;
};
} // namespace ix