I want to connect to an Apache Vysper Server using the Smack 4.1.8 library. But how to handle the bogus_mina_tls.crt that comes with Vysper? In Smack 3 you just could use:
ConnectionConfiguration connectionConfiguration = new ConnectionConfiguration("localhost", 5222);
connectionConfiguration.setSecurityMode(ConnectionConfiguration.SecurityMode.required);
connectionConfiguration.setSASLAuthenticationEnabled(true);
connectionConfiguration.setKeystorePath("src/main/resources/bogus_mina_tls.cert");
connectionConfiguration.setTruststorePath("src/main/resources/bogus_mina_tls.cert");
connectionConfiguration.setTruststorePassword("boguspw");
But how to do that in the Smack 4 API with the XMPPTCPConnectionConfiguration.builder()
?
Many Thanks
With Smack 4 you need to to construct the
SSLContext
for Smack yourself and set it withsetCustomSslContext(SSLContext)
. If you don't provide a customSSLContext
then Smack will use the runtime's default (i.e. resort to verifying the certificate with Java's truststore).