mirror of
https://github.com/irssi/irssi.git
synced 2026-08-21 17:42:49 +02:00
Keep cafile/capath, allow explicit disabling of tls_verify
This commit is contained in:
parent
2a7be842ae
commit
0f284e2c75
1 changed files with 7 additions and 12 deletions
|
|
@ -172,11 +172,6 @@ static void cmd_server_add_modify(const char *data, gboolean add)
|
||||||
rec->use_tls = FALSE;
|
rec->use_tls = FALSE;
|
||||||
/* tls_verify implies use_tls, disable it explicitly */
|
/* tls_verify implies use_tls, disable it explicitly */
|
||||||
rec->tls_verify = FALSE;
|
rec->tls_verify = FALSE;
|
||||||
/* explicitly null tls_cafile and tls_capath if we don't use tls */
|
|
||||||
if (rec->tls_cafile != NULL)
|
|
||||||
g_free_and_null(rec->tls_cafile);
|
|
||||||
if (rec->tls_capath != NULL)
|
|
||||||
g_free_and_null(rec->tls_capath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
value = g_hash_table_lookup(optlist, "tls_cert");
|
value = g_hash_table_lookup(optlist, "tls_cert");
|
||||||
|
|
@ -197,11 +192,6 @@ static void cmd_server_add_modify(const char *data, gboolean add)
|
||||||
if (value != NULL && *value != '\0')
|
if (value != NULL && *value != '\0')
|
||||||
rec->tls_pass = g_strdup(value);
|
rec->tls_pass = g_strdup(value);
|
||||||
|
|
||||||
if (g_hash_table_lookup(optlist, "tls_verify") || g_hash_table_lookup(optlist, "ssl_verify"))
|
|
||||||
rec->tls_verify = TRUE;
|
|
||||||
else if (g_hash_table_lookup(optlist, "notls_verify") || g_hash_table_lookup(optlist, "nossl_verify"))
|
|
||||||
rec->tls_verify = FALSE;
|
|
||||||
|
|
||||||
value = g_hash_table_lookup(optlist, "tls_cafile");
|
value = g_hash_table_lookup(optlist, "tls_cafile");
|
||||||
if (value == NULL)
|
if (value == NULL)
|
||||||
value = g_hash_table_lookup(optlist, "ssl_cafile");
|
value = g_hash_table_lookup(optlist, "ssl_cafile");
|
||||||
|
|
@ -232,10 +222,15 @@ static void cmd_server_add_modify(const char *data, gboolean add)
|
||||||
if (value != NULL && *value != '\0')
|
if (value != NULL && *value != '\0')
|
||||||
rec->tls_pinned_pubkey = g_strdup(value);
|
rec->tls_pinned_pubkey = g_strdup(value);
|
||||||
|
|
||||||
if ((rec->tls_cafile != NULL && rec->tls_cafile[0] != '\0')
|
if (rec->use_tls && ((rec->tls_cafile != NULL && rec->tls_cafile[0] != '\0')
|
||||||
|| (rec->tls_capath != NULL && rec->tls_capath[0] != '\0'))
|
|| (rec->tls_capath != NULL && rec->tls_capath[0] != '\0')))
|
||||||
rec->tls_verify = TRUE;
|
rec->tls_verify = TRUE;
|
||||||
|
|
||||||
|
if (g_hash_table_lookup(optlist, "tls_verify") || g_hash_table_lookup(optlist, "ssl_verify"))
|
||||||
|
rec->tls_verify = TRUE;
|
||||||
|
else if (g_hash_table_lookup(optlist, "notls_verify") || g_hash_table_lookup(optlist, "nossl_verify"))
|
||||||
|
rec->tls_verify = FALSE;
|
||||||
|
|
||||||
if ((rec->tls_cert != NULL && rec->tls_cert[0] != '\0') || rec->tls_verify == TRUE)
|
if ((rec->tls_cert != NULL && rec->tls_cert[0] != '\0') || rec->tls_verify == TRUE)
|
||||||
rec->use_tls = TRUE;
|
rec->use_tls = TRUE;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue