diff options
author | dequis <dx@dxzone.com.ar> | 2015-10-25 02:16:52 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2015-10-25 02:16:52 -0300 |
commit | e4c3041a398adb7ac938e0e3cd62ef52247658ad (patch) | |
tree | a315e0388a389d7a0168b066ebe0feae3511e5e6 | |
parent | d7969a1ae0c0b822929886195222b05433236bb7 (diff) |
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
-rw-r--r-- | protocols/purple/purple.c | 6 |
1 files changed, 6 insertions, 0 deletions
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; } |