powered by Jive Software

SSLException - NativeCrypto.SSL_do_handshake

Seems that I get annoying here, but I’ve got couple on new connection problems.

Smack version: Smack 4.2.0-rc3,

Client OS: Android 4.0, 4.4.2 (at list).

Error: javax.net.ssl.SSLException: Connection closed by peer in NativeCrypto.SSL_do_handshake.

Server: creep.im ejabberd 16.09 (according to IM Observatory ). I’ve got success on Android 7.1.2 and error on Android 4.0 and 4.4.2.

And I’ve tried our local server redsolution.com running ejabberd 16.09. And it worked! The only difference I could notice is zlib

Smack4.2.0-rc3 Connection error on Android 4.4.2 and creep.im server (ejabberd 16.090) · GitHub

Smack 4.2.0-rc3 success on Android 7.1.2 to creep.im (Ejabberd 16.09) · GitHub

Smack 4.2.0-rc3 success on Android 4.4.2 to redsolution.com (ejabberd 16.09) · GitHub

Error log:

2017-02-13_16-21-29 D/Smack﹕ SENT (0): <stream:stream xmlns=‘jabber:client’ to=‘creep.im’ xmlns:stream=‘http://etherx.jabber.org/streams’ version=‘1.0’ from=‘grigory.fedorov@creep.im’ xml:lang=‘en’>
2017-02-13_16-21-29 D/Smack﹕ RECV (0): <?xml version='1.0'?><stream:stream xmlns=‘jabber:client’ xmlns:stream=‘http://etherx.jabber.org/streams’ id=‘12638823842850150017’ from=‘creep.im’ version=‘1.0’ xml:lang=‘en’>stream:featureszlib</stream:features>2017-02-13_16-21-29 D/Smack﹕ SENT (0): 2017-02-13_16-21-29 D/Smack﹕ RECV (0): 2017-02-13_16-21-29 D/org.jivesoftware.smack.tcp.XMPPTCPConnection﹕ PacketWriter shutdown()2017-02-13_16-21-29 D/org.jivesoftware.smack.tcp.XMPPTCPConnection﹕ Reporting shutdownDone success in writer thread2017-02-13_16-21-29 D/org.jivesoftware.smack.tcp.XMPPTCPConnection﹕ PacketWriter has been shut down2017-02-13_16-21-29 D/org.jivesoftware.smack.tcp.XMPPTCPConnection﹕ PacketReader shutdown()2017-02-13_16-21-29 D/org.jivesoftware.smack.tcp.XMPPTCPConnection﹕ PacketReader has been shut down2017-02-13_16-21-29 W/org.jivesoftware.smack.AbstractXMPPConnection: Connection XMPPTCPConnection[not-authenticated] (0) closed with error2017-02-13_16-21-29 E/org.jivesoftware.smack.AbstractXMPPConnection﹕ javax.net.ssl.SSLException: Connection closed by peer2017-02-13_16-21-29 E/org.jivesoftware.smack.AbstractXMPPConnection﹕ com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)2017-02-13_16-21-29 E/org.jivesoftware.smack.AbstractXMPPConnection﹕ com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.ja va:406)2017-02-13_16-21-29 E/org.jivesoftware.smack.AbstractXMPPConnection﹕ com.android.org.conscrypt.OpenSSLSocketImpl$SSLInputStream.(OpenSSLSocket Impl.java:662)2017-02-13_16-21-29 E/org.jivesoftware.smack.AbstractXMPPConnection﹕ com.android.org.conscrypt.OpenSSLSocketImpl.getInputStream(OpenSSLSocketImpl.ja va:633)2017-02-13_16-21-29 E/org.jivesoftware.smack.AbstractXMPPConnection﹕ org.jivesoftware.smack.tcp.XMPPTCPConnection.initReaderAndWriter(XMPPTCPConnect ion.java:656)2017-02-13_16-21-29 E/org.jivesoftware.smack.AbstractXMPPConnection﹕ org.jivesoftware.smack.tcp.XMPPTCPConnection.proceedTLSReceived(XMPPTCPConnecti on.java:793)2017-02-13_16-21-29 E/org.jivesoftware.smack.AbstractXMPPConnection﹕ org.jivesoftware.smack.tcp.XMPPTCPConnection.access$1200(XMPPTCPConnection.java :149)2017-02-13_16-21-29 E/org.jivesoftware.smack.AbstractXMPPConnection﹕ org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPC onnection.java:1053)2017-02-13_16-21-29 E/org.jivesoftware.smack.AbstractXMPPConnection﹕ org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPCon nection.java:980)2017-02-13_16-21-29 E/org.jivesoftware.smack.AbstractXMPPConnection﹕ org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnecti on.java:996)2017-02-13_16-21-29 E/org.jivesoftware.smack.AbstractXMPPConnection﹕ java.lang.Thread.run(Thread.java:841)

I don’t think that’s something Smack related. Seems to be caused by the interaction of certain TLS stacks. The server side logs may provide more insight about what’s going on here.