Respond to 670 from the server by switching to TLS

If a client sends STARTTLS to the IRC server, once the IRC server responds
with a 670 then it will expect all future communications to happen over
TLS.
This commit is contained in:
Kyle Fuller
2011-10-18 16:04:33 +00:00
parent 200940756b
commit a25316710d
+9
View File
@@ -371,6 +371,15 @@ void CIRCSock::ReadLine(const CString& sData) {
}
break;
}
case 670:
// :hydra.sector5d.org 670 kylef :STARTTLS successful, go ahead with TLS handshake
// 670 is a responce to `STARTTLS` telling the client to switch to TLS
if (!GetSSL()) {
StartTLS();
}
break;
}
} else {
CNick Nick(sLine.Token(0).TrimPrefix_n());