Weird error when login is failed due to missing encryption
When Spark is configured to not use any encryption, while the server is configured to require encryption, the first login attempt returns either a timeout, or this error:
For some reason, Spark only gets that right on the second connection attempt (as well as attempts following that). The first attempt will have a result that suggests some kind of race condition.
The expected behavior is for "SSL/TLS required by server but disabled in client" to be shown, but for a reason that I've yet to figure out, that happens in Spark only when you try to connect for a second time (or more). The first time either gives you a timeout, or returns "Client is not, or no longer, connected. Did you call connect() before login()?"
that suggests some kind of race, but I've not been able to see where. There's a lot of async stuff going on in Smack...
connection.connect() doesn't block until after features are parsed, I think? How can I sync on that? I've tried using a connection listener, but that triggers 'connected' before it fails to parse features (and then triggers closedOnError)