Someone had that problem before, but it seames he didn't report it http://ejabberd.jabber.ru/node/974 the script self-cert.sh in /etc/jabber can create a valid certificate.
+*ejabberd-1.1.1-r1 (12 Oct 2006) + + 12 Oct 2006; Tony Vroon <chainsaw@gentoo.org> + +files/ejabberd-1.1.1-r1.initd, +files/self-cert-v2.sh, +files/ssl.cnf, + ejabberd-1.1.1.ebuild, +ejabberd-1.1.1-r1.ebuild: + Revision bump, robust start/stop script thanks to Chris Carlin + <ccarlin@physics.tamu.edu> and Dustin J. Mitchell <dustin@v.igoro.us> in bug + #145373. Statsdx & SOCKS5 proxy support thanks to Nikolaus Polak + <nik@linuxlovers.at> in bug #137724. And finally, thanks to Micha Krause + <linux@krausam.de> for pointing out that the SSL eclass did not create + certificates usable for S2S connections in bug #150088. This should fix it then :) Thanks for your report.