From 1012e11283da1bfae56e8ba9261473b670767d46 Mon Sep 17 00:00:00 2001 From: Dmitry Podgorny Date: Sat, 24 Jun 2017 21:33:30 +0300 Subject: [PATCH] Legacy SSL support Add "legacy" tls policy to /account and /connect commands. When this policy is specified the connection is connected with XMPP_CONN_LEGACY_SSL flag. Notice, legacy SSL and STARTTLS are not compatible and user has to know when exactly the new policy should be used. To enable it, run one of the next commands: /connect tls legacy [server ] /account set tls legacy Notice, there is no SRV record for legacy SSL. Therefore, you may need "server" property to connect successfully. Refer to configuration provided by your server. --- src/command/cmd_ac.c | 1 + src/command/cmd_defs.c | 6 ++++-- src/command/cmd_funcs.c | 8 +++++--- src/config/accounts.c | 3 ++- src/xmpp/connection.c | 2 ++ 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c index e5ec6f11..9bdd7f73 100644 --- a/src/command/cmd_ac.c +++ b/src/command/cmd_ac.c @@ -568,6 +568,7 @@ cmd_ac_init(void) tls_property_ac = autocomplete_new(); autocomplete_add(tls_property_ac, "force"); autocomplete_add(tls_property_ac, "allow"); + autocomplete_add(tls_property_ac, "legacy"); autocomplete_add(tls_property_ac, "disable"); join_property_ac = autocomplete_new(); diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c index ae77bf53..cbef1b3c 100644 --- a/src/command/cmd_defs.c +++ b/src/command/cmd_defs.c @@ -158,7 +158,7 @@ static struct cmd_t command_defs[] = CMD_TAG_CONNECTION) CMD_SYN( "/connect []", - "/connect [server ] [port ] [tls force|allow|disable]") + "/connect [server ] [port ] [tls force|allow|legacy|disable]") CMD_DESC( "Login to a chat service. " "If no account is specified, the default is used if one is configured. " @@ -169,6 +169,7 @@ static struct cmd_t command_defs[] = { "port ", "The port to use if different to the default (5222, or 5223 for SSL)." }, { "tls force", "Force TLS connection, and fail if one cannot be established, this is default behaviour." }, { "tls allow", "Use TLS for the connection if it is available." }, + { "tls legacy", "Use legacy TLS for the connection. It means server doesn't support STARTTLS and TLS is forced just after TCP connection is established." }, { "tls disable", "Disable TLS for the connection." }) CMD_EXAMPLES( "/connect", @@ -1984,7 +1985,7 @@ static struct cmd_t command_defs[] = "/account set otr ", "/account set pgpkeyid ", "/account set startscript