1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-07 18:23:13 +02:00

irc: add support of SNI in SSL connection to IRC server (closes #620)

This commit is contained in:
Sébastien Helleu
2015-12-10 07:13:20 +01:00
parent e6e8f34b4a
commit 136da36d7a
14 changed files with 63 additions and 13 deletions
+13
View File
@@ -1634,6 +1634,19 @@ network_connect_with_fork (struct t_hook *hook_connect)
unhook (hook_connect);
return;
}
rc = gnutls_server_name_set (*HOOK_CONNECT(hook_connect, gnutls_sess),
GNUTLS_NAME_DNS,
HOOK_CONNECT(hook_connect, address),
strlen (HOOK_CONNECT(hook_connect, address)));
if (rc != GNUTLS_E_SUCCESS)
{
(void) (HOOK_CONNECT(hook_connect, callback))
(hook_connect->callback_data,
WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR,
0, -1, _("set server name indication (SNI) failed"), NULL);
unhook (hook_connect);
return;
}
rc = gnutls_priority_set_direct (*HOOK_CONNECT(hook_connect, gnutls_sess),
HOOK_CONNECT(hook_connect, gnutls_priorities),
&pos_error);