title: vysper server login fail
body: <p>I'm making a vysper xmpp server.
  Here's my code:</p>
  
  <pre><code>public static void main(String[] args) throws Exception {
  
      XMPPServer server = new XMPPServer("myserver.org");
  
      StorageProviderRegistry providerRegistry = new MemoryStorageProviderRegistry();
  
      AccountManagement accountManagement = (AccountManagement) providerRegistry.retrieve(AccountManagement.class);
  
      Entity user = EntityImpl.parseUnchecked("user@myserver.org");
      accountManagement.addUser(user, "password");
  
      server.setStorageProviderRegistry(providerRegistry);
  
      server.addEndpoint(new TCPEndpoint())
  
      server.setTLSCertificateInfo(new File("keystore.jks"), "boguspw");
  
      //server.setTLSCertificateInfo(new File("bogus_mina_tls.cert"), "boguspw");
  
      server.start();
      System.out.println("Vysper server is running...");
  
      server.addModule(new EntityTimeModule());
      server.addModule(new VcardTempModule());
      server.addModule(new XmppPingModule());
      server.addModule(new PrivateDataModule());
  }
  </code></pre>
  
  <p>I've tried both certificate files. (keystore.jks,bogus_mina_tls.cert)</p>
  
  <p>After I start the server, it connects to it, and tries to login but it can't login.</p>
  
  <p>SmackConfiguration.setPacketReplyTimeout(5000);</p>
  
  <pre><code>    config = new ConnectionConfiguration("myserver.org", port, "localhost");
      config.setSelfSignedCertificateEnabled(true);
      config.setSecurityMode(ConnectionConfiguration.SecurityMode.enabled);
      config.setSASLAuthenticationEnabled(true);
  </code></pre>
  
  <p>//      config.setKeystorePath("keystore.jks");</p>
  
  <p>//      config.setTruststorePath("keystore.jks");</p>
  
  <pre><code>    config.setKeystorePath("bogus_mina_tls.cert");
      config.setTruststorePath("bogus_mina_tls.cert");
  
      config.setTruststorePassword("boguspw");
  
      XMPPConnection.DEBUG_ENABLED = true;
      connection = new XMPPConnection(config);
  
      try {
          connection.connect();
  
      } catch (XMPPException e) {
          System.out.println("Error connect");
          e.printStackTrace();
      }
  
      System.out.println("Connected: " + connection.isConnected());
  
      try {
          System.out.println(connection.isAuthenticated());
          connection.login("user", "password");
  
      } catch (XMPPException e) {
          System.out.println("Error login");
          e.printStackTrace();
      }
  </code></pre>
  
  <p>I catch this exception:</p>
  
  <blockquote>
    <p>SASL authentication PLAIN failed: incorrect-encoding:     at
    org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java:337)
      at
    org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:203)
      at org.jivesoftware.smack.Connection.login(Connection.java:348)     at
    com.protocol7.vysper.intro.WorkingClient.init(WorkingClient.java:57)
      at
    com.protocol7.vysper.intro.WorkingClient.(WorkingClient.java:27)
      at com.protocol7.vysper.intro.Runclient.main(Runclient.java:11)</p>
  </blockquote>
  
  <p>I've seen these examples (<a href="https://svn.apache.org/repos/asf/mina/vysper/trunk/server/core-inttest/src/test/java/org/apache/vysper/xmpp/modules/extension/xep0199_xmppping/AbstractIntegrationTestCase.java" rel="nofollow">1st</a>, <a href="http://protocol7.com/archives/2011/01/09/introducing-apache-vysper/" rel="nofollow">2nd</a>) but they don't work.</p>