Here's the issue with your iPhone. It needs to have the self-signed certificate the IM
server uses to be explicitly trusted.
*** Simply put, ALL YOU NEED TO DO is add the certificate, and tell your phone to trust it.***
#1 - Save this is the certificate to your phone (click the link & save it):
Jabber PEM certificate
#2 - Trust the certificate you just saved. This website has instructions, with screenshots,
on how to trust a certificate:
https://support.apple.com/en-us/102390
If you're interested in more information, this website (the post by libhart) has a detailed
overview on installing/adding a cert
https://discussions.apple.com/thread/253667401