0
votes

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

1

1 Answers

0
votes

With Smack 4 you need to to construct the SSLContext for Smack yourself and set it with setCustomSslContext(SSLContext). If you don't provide a custom SSLContext then Smack will use the runtime's default (i.e. resort to verifying the certificate with Java's truststore).