Skip to content

Commit

Permalink
purple: Fix certificate cache dir after changing user dir
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dequis committed Oct 25, 2015
1 parent d7969a1 commit e4c3041
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions protocols/purple/purple.c
Expand Up @@ -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;

Expand All @@ -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;
}

Expand Down

0 comments on commit e4c3041

Please sign in to comment.