I’ve installed OpenFire on a Win10 box in localhost installation (meaning domain/host is localhost), and I created two accounts. The other default settings I’ve not changed.
Then I use the simple sample code for smack as is:
XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder() .setUsernameAndPassword("aAccount","XXXX") .setXmppDomain("localhost") .setHost("localhost") .setSecurityMode(ConnectionConfiguration.SecurityMode.required) .build(); AbstractXMPPConnection connection = new XMPPTCPConnection(config); // Connect to the server connection.connect(); connection.login();
Now, the result (in IntelliJ/IDEA) is using Java SDK 16
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
The same code works with an external XMPP server, for example jabber.de !
It works also security disabled when connect to localhost. In Openfire, a self certified certificate for localhost is there, so …?
I’m completely lost what to try next. Do I need special options in OpenFire for this localhost setting? Client certifcate verification, or what ever?
Thank you very much for any hints