@ -45,8 +45,8 @@ enum
|
||||
|
||||
struct Ssl
|
||||
{
|
||||
SSL_CTX *m_context;
|
||||
SSL *m_ssl;
|
||||
SSL_CTX *m_context = nullptr;
|
||||
SSL *m_ssl = nullptr;
|
||||
};
|
||||
|
||||
static int verifyIgnoreCertCallback(X509_STORE_CTX *, void *)
|
||||
@ -289,9 +289,7 @@ void SecureSocket::initSsl(bool server)
|
||||
{
|
||||
std::scoped_lock ssl_lock{ssl_mutex_};
|
||||
|
||||
m_ssl = new Ssl();
|
||||
m_ssl->m_context = nullptr;
|
||||
m_ssl->m_ssl = nullptr;
|
||||
m_ssl = std::make_unique<Ssl>();
|
||||
|
||||
initContext(server);
|
||||
}
|
||||
@ -407,7 +405,6 @@ void SecureSocket::freeSSL()
|
||||
SSL_CTX_free(m_ssl->m_context);
|
||||
m_ssl->m_context = nullptr;
|
||||
}
|
||||
delete m_ssl;
|
||||
m_ssl = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,6 +11,8 @@
|
||||
#include "net/SecurityLevel.h"
|
||||
#include "net/TCPSocket.h"
|
||||
#include "net/XSocket.h"
|
||||
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
|
||||
class IEventQueue;
|
||||
@ -91,7 +93,7 @@ private:
|
||||
// by it.
|
||||
std::mutex ssl_mutex_;
|
||||
|
||||
Ssl *m_ssl = nullptr;
|
||||
std::unique_ptr<Ssl> m_ssl;
|
||||
bool m_secureReady = false;
|
||||
bool m_fatal = false;
|
||||
SecurityLevel m_securityLevel = SecurityLevel::Encrypted;
|
||||
|
||||
Reference in New Issue
Block a user