diff options
author | Dmitry Podgorny <pasis.ua@gmail.com> | 2018-11-06 14:01:27 +0200 |
---|---|---|
committer | Dmitry Podgorny <pasis.ua@gmail.com> | 2018-11-06 14:09:02 +0200 |
commit | 7f65aaa9a2ba1e7d9fe182cc18938fa39462e095 (patch) | |
tree | 7de15c627bd8d52ac34e38da1a23b2aa9216550e /src/command/cmd_funcs.c | |
parent | 671849c71152e7cc9272480ecab6d35f92e199ed (diff) | |
download | profani-tty-7f65aaa9a2ba1e7d9fe182cc18938fa39462e095.tar.gz |
Add option to trust server's certificate
New tls policy "trust" added to /connect and /account. With the policy TLS connection is established even with invalid certificate. Note, that trust policy forces TLS connection and it fails when server doesn't support TLS. Examples: /connect <jid> tls trust /account <name> set tls trust
Diffstat (limited to 'src/command/cmd_funcs.c')
-rw-r--r-- | src/command/cmd_funcs.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 6ce23849..7f1a791b 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -351,6 +351,7 @@ cmd_connect(ProfWin *window, const char *const command, gchar **args) if (tls_policy && (g_strcmp0(tls_policy, "force") != 0) && (g_strcmp0(tls_policy, "allow") != 0) && + (g_strcmp0(tls_policy, "trust") != 0) && (g_strcmp0(tls_policy, "disable") != 0) && (g_strcmp0(tls_policy, "legacy") != 0)) { cons_bad_cmd_usage(command); @@ -815,6 +816,7 @@ _account_set_tls(char *account_name, char *policy) { if ((g_strcmp0(policy, "force") != 0) && (g_strcmp0(policy, "allow") != 0) + && (g_strcmp0(policy, "trust") != 0) && (g_strcmp0(policy, "disable") != 0) && (g_strcmp0(policy, "legacy") != 0)) { cons_show("TLS policy must be one of: force, allow, legacy or disable."); |