title: (a)Smack: TLS socket is closed when trying to login with XMPP
body: <p>I am trying to connect with asmack (Android Gingerbread) to google talk. I have set <code>connectionConfig.setTruststoreType("BKS")</code> - so I get over the certificates problem. Now the failure is in the <code>XMPPConnection.proceedTLSReceived()</code> function, that is called after the server sent 'proceed' for the 'starttls' request.</p>
  
  <p>This function is supposed to initialize the TSL socket. It fails with an exception "java.net.SocketException: Socket closed".</p>
  
  <pre><code>// Verify certificate presented by the server
  context.init(kms,
      new javax.net.ssl.TrustManager[]{new ServerTrustManager(getServiceName(), config)},
      //new javax.net.ssl.TrustManager[]{new OpenTrustManager()},
      new java.security.SecureRandom());
  Socket plain = socket;
  // Secure the plain connection
  socket = context.getSocketFactory().createSocket(plain, plain.getInetAddress().getHostName(), plain.getPort(), false);
  socket.setSoTimeout(0); ////// THIS LINE THROWS THE EXCEPTION
  </code></pre>
  
  <p>Any clues?</p>
  
  <p>The socket is described as:
  SSL socket over Socket[addr=talk.google.com/173.194.70.125,port=5222,localport=34840]</p>
  
  <p>It fails on the emulator, and on my Galaxy S I9000.</p>