From c86d841ee2ddc3389f04bf8aa37faff6d1da9ac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 3 Feb 2016 10:18:43 +0100 Subject: [PATCH] protocol: Use appropriate default port when using SSL Port 6697 has been established as default for SSL encrypted IRC connections (https://tools.ietf.org/html/rfc7194), so default to that when SSL is requested. https://bugs.freedesktop.org/show_bug.cgi?id=94003 --- src/protocol.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/protocol.c b/src/protocol.c index 8e5a2cc..098140d 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -35,6 +35,7 @@ #define ENGLISH_NAME "IRC" #define VCARD_FIELD_NAME "x-" PROTOCOL_NAME #define DEFAULT_PORT 6667 +#define DEFAULT_SSL_PORT 6697 #define DEFAULT_KEEPALIVE_INTERVAL 30 /* sec */ G_DEFINE_TYPE (IdleProtocol, idle_protocol, TP_TYPE_BASE_PROTOCOL) @@ -131,7 +132,8 @@ new_connection (TpBaseProtocol *protocol G_GNUC_UNUSED, guint port = tp_asv_get_uint32 (params, "port", NULL); if (port == 0) - port = DEFAULT_PORT; + port = tp_asv_get_boolean (params, "use-ssl", NULL) ? DEFAULT_SSL_PORT + : DEFAULT_PORT; return g_object_new (IDLE_TYPE_CONNECTION, "protocol", PROTOCOL_NAME, -- 2.7.0