ejabberd has an SSL related bug when using erlang-12, which lead to problems of s2s incoming connections (see URL) In a way this is related to bug 202114 (same modules).
Created attachment 148067 [details, diff] upstream patch patch taken from upstream svn (https://forge.process-one.net/changelog/ejabberd?cs=1226)
This patch is now part of the 2.0.0 in portage, from bug #207586