{
doFeatures((Features)packet);
}
else if(packet instanceof StartTlsPacket)
{
StartTlsPacket tlsp = (StartTlsPacket)packet;
if(tlsp.hasFailed())
{
if(state == State.SASL)
{//TLS failed
//TODO ask user to try again or try without TLS or use old
//or try again, then try old ssl on 5223, then ask to connect without tls
connect.sendLoginError("TLS negotion failed");
}
else if (state == State.COMPRESSION)
{//compression failed
connect.sendLoginError("Compression negotion failed");
}
else if (state == State.BIND)
{//SASL failed
connect.sendLoginError("Wrong password");
String error = tlsp.getError();
if("incorrect-encoding".equals(error))
{//wrong base64
connect.sendLoginError("Bug in Jeti, please report");
Log.error("Sasl incorrect-encoding");
}