powered by Jive Software

Smack 4.4.0-alpha: sasl error \<bad-protocol/> return by ejabberd is not listed in smack enum SASLError

The sasl error <bad-protocol/> is not listed in smack enum SASLError. Not sure if there is a standard list for the sasl error.

2020-07-17 11:26:06.530 28946-31195/org.atalk.android D/SMACK: RECV (1): 
    <stream:features>
      <mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
        <mechanism>
          EXTERNAL
        </mechanism>
        <mechanism>
          PLAIN
        </mechanism>
        <mechanism>
          SCRAM-SHA-1
        </mechanism>
        <mechanism>
          X-OAUTH2
        </mechanism>
      </mechanisms>
      <register xmlns='http://jabber.org/features/iq-register'/>
    </stream:features>
2020-07-17 11:26:06.562 28946-31194/org.atalk.android D/SMACK: SENT (1): 
    <auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='EXTERNAL'>
      c3dvcmRmaXNoQGF0YWxrLnN5dGVzLm5ldA==
    </auth>
2020-07-17 11:26:06.568 28946-31195/org.atalk.android D/SMACK: RECV (1): 
    <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
      <bad-protocol/>
      <text xml:lang='en'>
        Failed to get peer certificate
      </text>
    </failure>
2020-07-17 11:26:06.575 28946-31195/org.atalk.android W/aTalk: [110665] org.jivesoftware.smack.sasl.SASLError.fromString() Could not transform string 'bad_protocol' to SASLError
    java.lang.IllegalArgumentException: No enum constant org.jivesoftware.smack.sasl.SASLError.bad_protocol
        at java.lang.Enum.valueOf(Enum.java:257)
        at org.jivesoftware.smack.sasl.SASLError.valueOf(SASLError.java:27)
        at org.jivesoftware.smack.sasl.SASLError.fromString(SASLError.java:51)
        at org.jivesoftware.smack.sasl.packet.SaslNonza$SASLFailure.<init>(SaslNonza.java:200)
        at org.jivesoftware.smack.provider.SaslFailureProvider.parse(SaslFailureProvider.java:59)
        at org.jivesoftware.smack.provider.SaslFailureProvider.parse(SaslFailureProvider.java:28)
        at org.jivesoftware.smack.provider.Provider.parse(Provider.java:53)
        at org.jivesoftware.smack.AbstractXMPPConnection.parseAndProcessNonza(AbstractXMPPConnection.java:1429)
        at org.jivesoftware.smack.tcp.XMPPTCPConnection.access$1700(XMPPTCPConnection.java:130)
        at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:992)
        at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$700(XMPPTCPConnection.java:898)
        at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:921)
        at java.lang.Thread.run(Thread.java:919)
2020-07-17 11:26:36.268 28946-31195/org.atalk.android D/SMACK: RECV (1): 
    <stream:error>
      <connection-timeout xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>
      <text xml:lang='en' xmlns='urn:ietf:params:xml:ns:xmpp-streams'>
        Idle connection
      </text>
    </stream:error>
2020-07-17 11:26:36.288 28946-31211/org.atalk.android W/aTalk: [110667] org.jivesoftware.smack.AbstractXMPPConnection.callConnectionClosedOnErrorListener() Connection XMPPTCPConnection[not-authenticated] (1) closed with error
    org.jivesoftware.smack.XMPPException$StreamErrorException: connection-timeout You can read more about the meaning of this stream error at http://xmpp.org/rfcs/rfc6120.html#streams-error-conditions
    <stream:error><connection-timeout xmlns='urn:ietf:params:xml:ns:xmpp-streams'/><text xml:lang='en'>Idle connection</text></stream:error>
        at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:966)
        at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$700(XMPPTCPConnection.java:898)
        at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:921)
        at java.lang.Thread.run(Thread.java:919)

That is because it is not specified in

https://www.rfc-editor.org/rfc/rfc6120.html#section-6.5

Thanks for the clarification. I will redirect the finding to ejabberd development team.

1 Like