title: SmackException$NoResponseException thrown when calling XMPPTCPConnection.login (Smack-4.1.0)
body: <p>Environment:</p>
  
  <ul>
  <li>Server : OpenFire v3.9.3.</li>
  <li>Client OS : Linux</li>
  <li>Server OS : Linux</li>
  <li>Java : 1.8.0_40</li>
  <li>Smack : smack-core-4.10, smack-im-4.1.0, smack-tcp-4.1.0, smack-sasl-provided-4.1.0</li>
  </ul>
  
  <p>Here is my test client code:</p>
  
  <pre><code>public class XMPPClientTest
  {
      public static void main(String[] args)
      {
  
          XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder()
                  .setHost("xmpp.domain")
                  .setServiceName("xmpp.domain")
                  .setSecurityMode(ConnectionConfiguration.SecurityMode.disabled)
                  .setDebuggerEnabled(true)
                  .setResource("Smack-client")
                  .build();
  
          AbstractXMPPConnection conn1 = new XMPPTCPConnection(config);
          try
          {
              System.out.println("connecting");
              conn1.connect();
              System.out.println("connected");
  
              System.out.println("logging in");
              conn1.login("user", "password");
              System.out.println("logged in");
  
              ChatManager chatmanager = ChatManager.getInstanceFor(conn1);
              Chat newChat = chatmanager.createChat("user@xmpp.domain");
  
              newChat.sendMessage("Goodbye World!");
              conn1.disconnect();
          }
          catch (IOException | SmackException | XMPPException ioe)
          {
              ioe.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>Here is the output</p>
  
  <pre><code>connecting
  11:49:40 AM SENT (0): &lt;stream:stream xmlns='jabber:client' to='xmpp.domain' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'&gt;
  11:49:40 AM RECV (0): &lt;?xml version='1.0' encoding='UTF-8'?&gt;&lt;stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="xmpp.domain" id="3d0a3800" xml:lang="en" version="1.0"&gt;
  11:49:40 AM RECV (0): &lt;stream:features&gt;&lt;starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"&gt;&lt;/starttls&gt;&lt;mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"&gt;&lt;mechanism&gt;PLAIN&lt;/mechanism&gt;&lt;mechanism&gt;CRAM-MD5&lt;/mechanism&gt;&lt;mechanism&gt;DIGEST-MD5&lt;/mechanism&gt;&lt;/mechanisms&gt;&lt;compression xmlns="http://jabber.org/features/compress"&gt;&lt;method&gt;zlib&lt;/method&gt;&lt;/compression&gt;&lt;auth xmlns="http://jabber.org/features/iq-auth"/&gt;&lt;/stream:features&gt;
  logging in
  11:49:40 AM SENT (0): &lt;auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='DIGEST-MD5'&gt;=&lt;/auth&gt;
  11:49:40 AM RECV (0): &lt;challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl"&gt;cmVhbG09InhtcHAua2lkY2hlY2suY29tIixub25jZT0iYXpqS2N3UUh3S2RjTTVQeWt4OEo2YmdsM1VoMk9JQkVTallBWXFLOSIscW9wPSJhdXRoIixjaGFyc2V0PXV0Zi04LGFsZ29yaXRobT1tZDUtc2Vzcw==&lt;/challenge&gt;
  org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 5000ms (~5s). Used filter: No filter used or filter was 'null'.
      at org.jivesoftware.smack.SmackException$NoResponseException.newWith(SmackException.java:106)
      at org.jivesoftware.smack.SmackException$NoResponseException.newWith(SmackException.java:85)
      at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java:250)
      at org.jivesoftware.smack.tcp.XMPPTCPConnection.loginNonAnonymously(XMPPTCPConnection.java:365)
      at org.jivesoftware.smack.AbstractXMPPConnection.login(AbstractXMPPConnection.java:452)
      at org.jivesoftware.smack.AbstractXMPPConnection.login(AbstractXMPPConnection.java:427)
      at com.forge.label.app.driver.test.XMPPClientTest.main(XMPPClientTest.java:39)
  Apr 07, 2015 11:49:45 AM org.jivesoftware.smack.AbstractXMPPConnection callConnectionClosedOnErrorListener
  WARNING: Connection closed with error
  java.lang.NullPointerException
      at org.jivesoftware.smack.util.stringencoder.Base64.decode(Base64.java:86)
      at org.jivesoftware.smack.sasl.SASLMechanism.challengeReceived(SASLMechanism.java:229)
      at org.jivesoftware.smack.SASLAuthentication.challengeReceived(SASLAuthentication.java:328)
      at org.jivesoftware.smack.SASLAuthentication.challengeReceived(SASLAuthentication.java:313)
      at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1040)
      at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$200(XMPPTCPConnection.java:937)
      at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:952)
      at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>I can connect to the server using IM clients like Pidgin. But when I try to use the Smack library I get the above errors. The only "solution" I've found for this problem is to call XMPPTCPConnectionConfiguration.setSecurityMode(SecurityMode.disabled) but that has not worked in my case.</p>
  
  <p>From the debugging output it appears that the server is sending a challenge and the client is ignoring it.</p>
  
  <p>Any help would be appreciated.</p>