I analysed TLS handshake with some older GNU TLS version and found the reason why SailfishOS XMPP client is not connecting with ejabberd.
The “bug” was my Let’s Encrypt certificate created as EC256 keytype, however 11 year old GNU TLS 2.12.24 library on our phones does not support this kind of cryptographic feature. After creating a new certificate as RSA keytype the connection finally works.