diff --git a/src/IRCNetwork.cpp b/src/IRCNetwork.cpp index 00be3465..1f4c3742 100644 --- a/src/IRCNetwork.cpp +++ b/src/IRCNetwork.cpp @@ -828,16 +828,18 @@ bool CIRCNetwork::Connect() { CZNC::Get().AddServerThrottle(pServer->GetName()); - CIRCSock *pIRCSock = new CIRCSock(this); - pIRCSock->SetPass(pServer->GetPass()); - - bool bSSL = false; -#ifdef HAVE_LIBSSL - if (pServer->IsSSL()) { - bSSL = true; + bool bSSL = pServer->IsSSL(); +#ifndef HAVE_LIBSSL + if (bSSL) { + PutStatus("Cannot connect to [" + pServer->GetString(false) + "], ZNC is not compiled with SSL."); + CZNC::Get().AddNetworkToQueue(this); + return false; } #endif + CIRCSock *pIRCSock = new CIRCSock(this); + pIRCSock->SetPass(pServer->GetPass()); + DEBUG("Connecting user/network [" << m_sName << "/" << m_sName << "]"); NETWORKMODULECALL(OnIRCConnecting(pIRCSock), m_pUser, this, NULL,