Permalink
Browse files

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.
  • Loading branch information...
1 parent 2009407 commit a25316710d807019f99e3407ffda2e4a87a1f913 @kylef kylef committed Oct 18, 2011
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/IRCSock.cpp
View
@@ -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());

0 comments on commit a253167

Please sign in to comment.