Permalink
Browse files

Don't connect to SSLed IRC servers when ZNC is not compiled with SSL

  • Loading branch information...
1 parent a4aedc9 commit c7d171bfa16527bf34c032953e45bc92e7f2f576 @kylef kylef committed Oct 4, 2011
Showing with 9 additions and 7 deletions.
  1. +9 −7 src/IRCNetwork.cpp
View
16 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,

0 comments on commit c7d171b

Please sign in to comment.