From a25316710d807019f99e3407ffda2e4a87a1f913 Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Tue, 18 Oct 2011 16:04:33 +0000 Subject: [PATCH] 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. --- src/IRCSock.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/IRCSock.cpp b/src/IRCSock.cpp index a8d9894f..7f535e9e 100644 --- a/src/IRCSock.cpp +++ b/src/IRCSock.cpp @@ -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());