I took a look at the Spark and Smack code - and found out that what is needed is already available in the Smack-api.
If one sets for the ConnectionConfiguration following booleans:
Then certificates are checked as supposed.
In Spark connectionConfiguration is used in two places - LoginDialog.java and AccountCreationWizard.java. I did a quick test and confirmed that I’'m no longer unable to connect to my server that has a self signed certificate – just as I would expect.
However Spark gives “Invalid username / password” errormessage to user - though there is SSLHandshake error.
“javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: root certificate not trusted of huimaconsulting.com”
My suggestion is that it would be a configurable option in Spark to check the certificate chain and root certificate - and show visually to user whether one can really trust the communication.