mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 20:33:46 +02:00
Support for sending SSL certificate to server and optionally verify server's
certificate. See the -ssl_* options for /SERVER and /SERVER ADD. Patch by Joel Eriksson <je-irssi@bitnux.com>. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3146 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
b1e2d7b5ef
commit
43b0d36ee1
11 changed files with 275 additions and 30 deletions
|
|
@ -147,6 +147,32 @@ static void cmd_server_add(const char *data)
|
|||
if (g_hash_table_lookup(optlist, "ssl"))
|
||||
rec->use_ssl = TRUE;
|
||||
|
||||
value = g_hash_table_lookup(optlist, "ssl_cert");
|
||||
if (value != NULL && *value != '\0')
|
||||
rec->ssl_cert = g_strdup(value);
|
||||
|
||||
value = g_hash_table_lookup(optlist, "ssl_pkey");
|
||||
if (value != NULL && *value != '\0')
|
||||
rec->ssl_pkey = g_strdup(value);
|
||||
|
||||
if (g_hash_table_lookup(optlist, "ssl_verify"))
|
||||
rec->ssl_verify = TRUE;
|
||||
|
||||
value = g_hash_table_lookup(optlist, "ssl_cafile");
|
||||
if (value != NULL && *value != '\0')
|
||||
rec->ssl_cafile = g_strdup(value);
|
||||
|
||||
value = g_hash_table_lookup(optlist, "ssl_capath");
|
||||
if (value != NULL && *value != '\0')
|
||||
rec->ssl_capath = g_strdup(value);
|
||||
|
||||
if ((rec->ssl_cafile != NULL && rec->ssl_cafile[0] != '\0')
|
||||
|| (rec->ssl_capath != NULL && rec->ssl_capath[0] != '\0'))
|
||||
rec->ssl_verify = TRUE;
|
||||
|
||||
if ((rec->ssl_cert != NULL && rec->ssl_cert[0] != '\0') || rec->ssl_verify == TRUE)
|
||||
rec->use_ssl = TRUE;
|
||||
|
||||
if (g_hash_table_lookup(optlist, "auto")) rec->autoconnect = TRUE;
|
||||
if (g_hash_table_lookup(optlist, "noauto")) rec->autoconnect = FALSE;
|
||||
if (g_hash_table_lookup(optlist, "proxy")) rec->no_proxy = FALSE;
|
||||
|
|
@ -343,7 +369,7 @@ void fe_server_init(void)
|
|||
command_bind("server remove", NULL, (SIGNAL_FUNC) cmd_server_remove);
|
||||
command_bind_first("server", NULL, (SIGNAL_FUNC) server_command);
|
||||
command_bind_first("disconnect", NULL, (SIGNAL_FUNC) server_command);
|
||||
command_set_options("server add", "4 6 ssl auto noauto proxy noproxy -host -port");
|
||||
command_set_options("server add", "4 6 ssl +ssl_cert +ssl_pkey ssl_verify +ssl_cafile +ssl_capath auto noauto proxy noproxy -host -port");
|
||||
|
||||
signal_add("server looking", (SIGNAL_FUNC) sig_server_looking);
|
||||
signal_add("server connecting", (SIGNAL_FUNC) sig_server_connecting);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue