Added /tls trust

This commit is contained in:
James Booth
2015-11-10 23:26:19 +00:00
parent fcfdc175b6
commit 1e34b9c914
2 changed files with 21 additions and 4 deletions

View File

@@ -193,6 +193,20 @@ cmd_tls(ProfWin *window, const char *const command, gchar **args)
#else
cons_show("Certificate path setting only supported when built with libmesode.");
return TRUE;
#endif
} else if (g_strcmp0(args[0], "trust") == 0) {
#ifdef HAVE_LIBMESODE
TLSCertificate *cert = jabber_get_tls_peer_cert();
if (!tlscerts_exists(cert->fingerprint)) {
cons_show("Adding %s to trusted certificates.", cert->fingerprint);
tlscerts_add(cert);
} else {
cons_show("Certificate %s already trusted.", cert->fingerprint);
}
return TRUE;
#else
cons_show("Manual certificate trust only supported when built with libmesode.");
return TRUE;
#endif
} else if (g_strcmp0(args[0], "trusted") == 0) {
#ifdef HAVE_LIBMESODE