diff options
author | Florent Le Coz <louiz@louiz.org> | 2014-05-18 20:23:08 +0200 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2014-06-08 05:07:54 +0200 |
commit | 23f32ba39ebe5e9bbdfc4dd00d9914c0f0447ef4 (patch) | |
tree | aacd08a1fa9c56d3949e659238071ea32402907f /src/irc/irc_client.hpp | |
parent | fa071309917252cd76d1334eedc6703057d1f29f (diff) | |
download | biboumi-23f32ba39ebe5e9bbdfc4dd00d9914c0f0447ef4.tar.gz biboumi-23f32ba39ebe5e9bbdfc4dd00d9914c0f0447ef4.tar.bz2 biboumi-23f32ba39ebe5e9bbdfc4dd00d9914c0f0447ef4.tar.xz biboumi-23f32ba39ebe5e9bbdfc4dd00d9914c0f0447ef4.zip |
Implement TLS support using Botan
For now, it tries two TLS ports and then connects to the non-tls port. In
the future we would like the user to be able to configure that.
fix #2435
Diffstat (limited to 'src/irc/irc_client.hpp')
-rw-r--r-- | src/irc/irc_client.hpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/irc/irc_client.hpp b/src/irc/irc_client.hpp index 2f28c95..7dff1db 100644 --- a/src/irc/irc_client.hpp +++ b/src/irc/irc_client.hpp @@ -11,6 +11,7 @@ #include <memory> #include <vector> #include <string> +#include <stack> #include <map> #include <set> @@ -19,8 +20,6 @@ class Bridge; /** * Represent one IRC client, i.e. an endpoint connected to a single IRC * server, through a TCP socket, receiving and sending commands to it. - * - * TODO: TLS support, maybe, but that's not high priority */ class IrcClient: public SocketHandler { @@ -280,6 +279,12 @@ private: * (for example 'ahov' is a common order). */ std::vector<char> sorted_user_modes; + /** + * A list of ports to which we will try to connect, in reverse. Each port + * is associated with a boolean telling if we should use TLS or not if the + * connection succeeds on that port. + */ + std::stack<std::pair<std::string, bool>> ports_to_try; IrcClient(const IrcClient&) = delete; IrcClient(IrcClient&&) = delete; |