Smack uses the HostName instead of the configured DomainName when requesting TLS certificate from xmpp server.
It is similar to issue openssl CLI with -servicename set to HostName
openssl s_client -servername atalk.sytes.net -connect atalk.sytes.net:5222 -starttls xmpp
instead of using the defined DomainName for -servicename
openssl s_client -servername atalk.org -connect atalk.sytes.net:5222 -starttls xmpp
Please refer to the following link for more information:
[https://github.com/processone/ejabberd/issues/2371#issuecomment-379487165]