XMPP cert handling improvements, ufw rules, and tests