From e4c3041a398adb7ac938e0e3cd62ef52247658ad Mon Sep 17 00:00:00 2001 From: dequis Date: Sun, 25 Oct 2015 02:16:52 -0300 Subject: purple: Fix certificate cache dir after changing user dir This fixes the issue with getting asked to accept certificates that are perfectly valid, every time. The directory is normally created by x509_tls_peers_init(), a few calls below purple_core_init(), which is at module initialization time, way before we have an irc username to fix the user directory. So it creates the wrong directory first, and now we have to fix it manually. And apparently not being able to save cached certificates somehow means they aren't trusted. For some reason. < krisfremen> "for some reason" < dx> idklol --- protocols/purple/purple.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'protocols') diff --git a/protocols/purple/purple.c b/protocols/purple/purple.c index a24b064a..5ab665fd 100644 --- a/protocols/purple/purple.c +++ b/protocols/purple/purple.c @@ -112,6 +112,7 @@ static void purple_init(account_t *acc) Remember that libpurple is not really meant to be used on public servers anyway! */ if (!dir_fixed) { + PurpleCertificatePool *pool; irc_t *irc = acc->bee->ui_data; char *dir; @@ -127,6 +128,11 @@ static void purple_init(account_t *acc) purple_prefs_set_bool("/purple/proxy/socks4_remotedns", TRUE); } + /* re-create the certificate cache directory */ + pool = purple_certificate_find_pool("x509", "tls_peers"); + dir = purple_certificate_pool_mkpath(pool, NULL); + purple_build_dir(dir, 0700); + dir_fixed = TRUE; } -- cgit v1.2.3