The following observation is based on aTalk with smack-4.4.0 and the applied patch below.
XMPPBOSHConnection.patch (4.9 KB)
Below are the aTalk debug log for aTalk initial BOSH connection login and ejabberd server debug log.
From ejabberd server debug log, the BOSH connection time between <auth/> and <challenge/> is immediate. However it seems that smack BoshClient is holding the <challenge/> nonza until it throws NoResponseException. Only then it sends the <response/> nonza. Actually the login is successful as from ejabberd debug log.
i.e. 17:42:19.170 <auth/> => 17:42:19.170 <challenge/>
============== aTalk BOSH connection login debug log =========
2019-10-21 17:42:17.737 1322-1898/org.atalk.android D/SMACK: SENT (1):
<body ver='1.8' wait='60' xmpp:version='1.0' rid='5336845303807709' xmlns:xmpp='urn:xmpp:xbosh' hold='1' xml:lang='en' ack='1' to='atalk.org' xmlns='http://jabber.org/protocol/httpbind'>
</body>
019-10-21 17:42:18.047 1322-2358/org.atalk.android D/SMACK: RECV (1):
<body xmpp:version='1.0' authid='8221667300579328793' xmlns='http://jabber.org/protocol/httpbind' sid='b3512ad87ed03dcd93e969619afa52028f0d2943' wait='60' ver='1.11' polling='2' inactivity='30' hold='1' xmpp:restartlogic='true' requests='2' secure='true' maxpause='120' xmlns:xmpp='urn:xmpp:xbosh' xmlns:stream='http://etherx.jabber.org/streams' from='atalk.org'>
<stream:features>
<mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
<mechanism>
PLAIN
</mechanism>
<mechanism>
SCRAM-SHA-1
</mechanism>
<mechanism>
X-OAUTH2
</mechanism>
</mechanisms>
<register xmlns='http://jabber.org/features/iq-register'/>
</stream:features>
</body>
2019-10-21 17:42:18.061 1322-2356/org.atalk.android D/SMACK: SENT (1):
<body rid='5336845303807710' sid='b3512ad87ed03dcd93e969619afa52028f0d2943' xmlns='http://jabber.org/protocol/httpbind'>
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='SCRAM-SHA-1'>
biwsbj1zd29yZGZpc2gscj0mfk9YaFkvXysoejxsZHZxKE4jYihCVnQvX0phMVhvMQ==
</auth>
</body>
2019-10-21 17:42:28.065 1322-2356/org.atalk.android W/aTalk: [102552] org.igniterealtime.jbosh.BOSHClient.fireConnectionEstablished() Unhandled Exception
java.lang.RuntimeException: org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 10000ms (~10s). While waiting for successful SASL authentication
at org.jivesoftware.smack.bosh.XMPPBOSHConnection$BOSHConnectionListener.connectionEvent(XMPPBOSHConnection.java:447)
at org.igniterealtime.jbosh.BOSHClient.fireConnectionEstablished(BOSHClient.java:1633)
at org.igniterealtime.jbosh.BOSHClient.processExchange(BOSHClient.java:1165)
at org.igniterealtime.jbosh.BOSHClient.processMessages(BOSHClient.java:998)
at org.igniterealtime.jbosh.BOSHClient.access$300(BOSHClient.java:100)
at org.igniterealtime.jbosh.BOSHClient$RequestProcessor.run(BOSHClient.java:1727)
at java.lang.Thread.run(Thread.java:764)
Caused by: org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 10000ms (~10s). While waiting for successful SASL authentication
at org.jivesoftware.smack.sasl.SASLMechanism.throwExceptionIfRequired(SASLMechanism.java:339)
at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java:211)
at org.jivesoftware.smack.AbstractXMPPConnection.authenticate(AbstractXMPPConnection.java:861)
at org.jivesoftware.smack.bosh.XMPPBOSHConnection.loginInternal(XMPPBOSHConnection.java:221)
at org.jivesoftware.smack.AbstractXMPPConnection.login(AbstractXMPPConnection.java:646)
at org.jivesoftware.smack.AbstractXMPPConnection.login(AbstractXMPPConnection.java:603)
at org.jivesoftware.smack.bosh.XMPPBOSHConnection$BOSHConnectionListener.connectionEvent(XMPPBOSHConnection.java:444)
at org.igniterealtime.jbosh.BOSHClient.fireConnectionEstablished(BOSHClient.java:1633)
at org.igniterealtime.jbosh.BOSHClient.processExchange(BOSHClient.java:1165)
at org.igniterealtime.jbosh.BOSHClient.processMessages(BOSHClient.java:998)
at org.igniterealtime.jbosh.BOSHClient.access$300(BOSHClient.java:100)
at org.igniterealtime.jbosh.BOSHClient$RequestProcessor.run(BOSHClient.java:1727)
at java.lang.Thread.run(Thread.java:764)
2019-10-21 17:42:28.067 1322-2360/org.atalk.android D/SMACK: SENT (1):
<body rid='5336845303807711' ack='5336845303807709' sid='b3512ad87ed03dcd93e969619afa52028f0d2943' xmlns='http://jabber.org/protocol/httpbind'>
<response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
Yz1iaXdzLHI9Jn5PWGhZL18rKHo8bGR2cShOI2IoQlZ0L19KYTFYbzFNTWFoUnpVcXJHVTlvSjhSZ3hWdEZ3PT0scD1neFhFTEM1Q1Z4aHc2UXQ5ZWlkQVVvR1hPU0U9
</response>
</body>
2019-10-21 17:42:28.068 1322-2358/org.atalk.android D/SMACK: RECV (1):
<body xmlns='http://jabber.org/protocol/httpbind'>
<challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
cj0mfk9YaFkvXysoejxsZHZxKE4jYihCVnQvX0phMVhvMU1NYWhSelVxckdVOW9KOFJneFZ0Rnc9PSxzPTVXVENHSnk1dk1FUWJpNmZWRVJ1S0E9PSxpPTQwOTY=
</challenge>
</body>
========== ejabberd debug log ============
2019-10-21 17:42:19.110 [debug] <0.749.0>@ejabberd_bosh:wait_for_session:317 got request:
** RequestID: 5336845303807709
** Request: {body,<<>>,[{to,<<"atalk.org">>},{ack,1},{<<"xml:lang">>,<<"en">>},{hold,1},{rid,5336845303807709},{'xmpp:version',<<"1.0">>},{wait,60},{ver,<<"1.8">>},{<<"xmlns:xmpp">>,<<"urn:xmpp:xbosh">>}],[],193}
2019-10-21 17:42:19.111 [debug] <0.749.0>@ejabberd_bosh:do_reply:679 send reply:
** RequestID: 5336845303807709
** Reply: {body,<<>>,[{sid,<<"b3512ad87ed03dcd93e969619afa52028f0d2943">>},{wait,60},{ver,<<"1.11">>},{polling,2},{inactivity,30},{hold,1},{'xmpp:restartlogic',true},{requests,2},{secure,true},{maxpause,120},{'xmlns:xmpp',<<"urn:xmpp:xbosh">>},{'xmlns:stream',<<"http://etherx.jabber.org/streams">>},{from,<<"atalk.org">>}],[{xmlstreamstart,<<"stream:stream">>,[{<<"id">>,<<"8221667300579328793">>},{<<"version">>,<<"1.0">>},{<<"xml:lang">>,<<"en">>},{<<"xmlns:stream">>,<<"http://etherx.jabber.org/streams">>},{<<"from">>,<<"atalk.org">>},{<<"xmlns">>,<<"jabber:client">>}]},{xmlstreamelement,{xmlel,<<"stream:features">>,[],[{xmlel,<<"mechanisms">>,[{<<"xmlns">>,<<"urn:ietf:params:xml:ns:xmpp-sasl">>}],[{xmlel,<<"mechanism">>,[],[{xmlcdata,<<"PLAIN">>}]},{xmlel,<<"mechanism">>,[],[{xmlcdata,<<"SCRAM-SHA-1">>}]},{xmlel,<<"mechanism">>,[],[{xmlcdata,<<"X-OAUTH2">>}]}]},{xmlel,<<"register">>,[{<<"xmlns">>,<<"http://jabber.org/features/iq-register">>}],[]}]}}],0}
** To: {<0.748.0>,#Ref<0.1092676128.2977169409.258753>}
2019-10-21 17:42:19.169 [debug] <0.748.0>@mod_bosh:process:69 Incoming data: <<"<body rid='5336845303807710' sid='b3512ad87ed03dcd93e969619afa52028f0d2943' xmlns='http://jabber.org/protocol/httpbind'><auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='SCRAM-SHA-1'>biwsbj1zd29yZGZpc2gscj0mfk9YaFkvXysoejxsZHZxKE4jYihCVnQvX0phMVhvMQ==</auth></body>">>
2019-10-21 17:42:19.170 [debug] <0.749.0>@ejabberd_bosh:active:384 got request:
** Request: {body,<<>>,[{sid,<<"b3512ad87ed03dcd93e969619afa52028f0d2943">>},{rid,5336845303807710}],[{xmlstreamelement,{xmlel,<<"auth">>,[{<<"xmlns">>,<<"urn:ietf:params:xml:ns:xmpp-sasl">>},{<<"mechanism">>,<<"SCRAM-SHA-1">>}],[{xmlcdata,<<"biwsbj1zd29yZGZpc2gscj0mfk9YaFkvXysoejxsZHZxKE4jYihCVnQvX0phMVhvMQ==">>}]}}],273}
2019-10-21 17:42:19.170 [debug] <0.749.0>@ejabberd_bosh:do_reply:679 send reply:
** RequestID: 5336845303807710
** Reply: {body,<<>>,[],[{xmlstreamelement,{xmlel,<<"challenge">>,[{<<"xmlns">>,<<"urn:ietf:params:xml:ns:xmpp-sasl">>}],[{xmlcdata,<<"cj0mfk9YaFkvXysoejxsZHZxKE4jYihCVnQvX0phMVhvMU1NYWhSelVxckdVOW9KOFJneFZ0Rnc9PSxzPTVXVENHSnk1dk1FUWJpNmZWRVJ1S0E9PSxpPTQwOTY=">>}]}}],0}
2019-10-21 17:42:29.291 [debug] <0.748.0>@mod_bosh:process:69 Incoming data: <<"<body rid='5336845303807711' ack='5336845303807709' sid='b3512ad87ed03dcd93e969619afa52028f0d2943' xmlns='http://jabber.org/protocol/httpbind'><response xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>Yz1iaXdzLHI9Jn5PWGhZL18rKHo8bGR2cShOI2IoQlZ0L19KYTFYbzFNTWFoUnpVcXJHVTlvSjhSZ3hWdEZ3PT0scD1neFhFTEM1Q1Z4aHc2UXQ5ZWlkQVVvR1hPU0U9</response></body>">>
2019-10-21 17:42:29.293 [debug] <0.749.0>@ejabberd_bosh:do_reply:679 send reply:
** RequestID: 5336845303807711
** Reply: {body,<<>>,[],[{xmlstreamelement,{xmlel,<<"success">>,[{<<"xmlns">>,<<"urn:ietf:params:xml:ns:xmpp-sasl">>}],[{xmlcdata,
<<"dj1HMzViZ1J0SUZCY2dxNkYzeUxZWmpEWnYxakU9">>}]}}],0}```