0

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 Answers1

0

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).

Flow
  • 23,572
  • 15
  • 99
  • 156
  • and do i need the certificate also? how to set this up? could you give me a tutorial or something like this.... sorry i am quite new to ssl ;) – Sebastian85 Aug 05 '16 at 11:46