Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to handle TLS certificate using Smack XMPP library in java
    primarykey
    data
    text
    <p>HI everyone. I've just started to play a little with XMPP in java, both server and client side. On the server side I'm using Apache Vysper 0.7 and on client side I'm using Ignite Smack 3.1.0 I'm using a small XMPP embedded server from the apache vysper demo page using a TLS certificate that comes with the source code:</p> <pre><code> XMPPServer server = new XMPPServer("localhost"); StorageProviderRegistry providerRegistry = new MemoryStorageProviderRegistry(); AccountManagement accountManagement = (AccountManagement) providerRegistry.retrieve(AccountManagement.class); Entity user = EntityImpl.parseUnchecked("user@localhost"); accountManagement.addUser(user, "password"); server.setStorageProviderRegistry(providerRegistry); server.addEndpoint(new TCPEndpoint()); server.setTLSCertificateInfo(new File("bogus_mina_tls.cert"), "boguspw"); server.start(); System.out.println("Vysper server is running..."); </code></pre> <p>The problem is that this is not a correct/valid certificate. If I test my server using pidgin an alert window pops up and tells me the certificate is invalid and a button in case I want to add an exception for this.</p> <p>What I want is to do the same thing with the Smack api, but I don't know how.</p> <p>on my smack api I'm using something like this:</p> <pre><code> ConnectionConfiguration config = new ConnectionConfiguration("localhost",5222, "localhost"); config.setSASLAuthenticationEnabled(false); connection = new XMPPConnection(config); connection.connect(); connection.login(userName, password); </code></pre> <p>So here it is. What do I need to do to accept or decline invalid certificates ? Thanks for your help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload