summaryrefslogtreecommitdiff
path: root/src/plugins/relay/relay-network.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2014-10-26 18:03:47 +0100
committerSébastien Helleu <flashcode@flashtux.org>2014-10-26 18:03:47 +0100
commit134a5f53d498ba617f0aafd5479451a2073f6c07 (patch)
tree830c9b33dd9d5528cdb29c7f17c3989d9d60b721 /src/plugins/relay/relay-network.c
parenta092e727318b9d55d42e5a4ffb94254eec6c50ec (diff)
downloadweechat-134a5f53d498ba617f0aafd5479451a2073f6c07.zip
relay: add option relay.network.ssl_priorities (closes #234)
Diffstat (limited to 'src/plugins/relay/relay-network.c')
-rw-r--r--src/plugins/relay/relay-network.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/src/plugins/relay/relay-network.c b/src/plugins/relay/relay-network.c
index c65dec985..e15c84a87 100644
--- a/src/plugins/relay/relay-network.c
+++ b/src/plugins/relay/relay-network.c
@@ -104,6 +104,28 @@ relay_network_set_ssl_cert_key (int verbose)
}
/*
+ * Sets gnutls priority cache.
+ */
+
+void
+relay_network_set_priority ()
+{
+#ifdef HAVE_GNUTLS
+ if (gnutls_priority_init (relay_gnutls_priority_cache,
+ weechat_config_string (
+ relay_config_network_ssl_priorities),
+ NULL) != GNUTLS_E_SUCCESS)
+ {
+ weechat_printf (NULL,
+ _("%s%s: unable to initialize priority for SSL"),
+ weechat_prefix ("error"), RELAY_PLUGIN_NAME);
+ free (relay_gnutls_priority_cache);
+ relay_gnutls_priority_cache = NULL;
+ }
+#endif
+}
+
+/*
* Initializes network for relay.
*/
@@ -119,17 +141,7 @@ relay_network_init ()
/* priority */
relay_gnutls_priority_cache = malloc (sizeof (*relay_gnutls_priority_cache));
if (relay_gnutls_priority_cache)
- {
- if (gnutls_priority_init (relay_gnutls_priority_cache,
- "PERFORMANCE", NULL) != GNUTLS_E_SUCCESS)
- {
- weechat_printf (NULL,
- _("%s%s: unable to initialize priority for SSL"),
- weechat_prefix ("error"), RELAY_PLUGIN_NAME);
- free (relay_gnutls_priority_cache);
- relay_gnutls_priority_cache = NULL;
- }
- }
+ relay_network_set_priority ();
#endif
relay_network_init_ok = 1;
}