Hi,
I have the same problem here. I have no problem if using Android 4.4.4 via SSL, however when I use Android 5 with asmack (4.0.8) to connect to Openfire (3.9.3) via SSL, it throws the following exception:
org.jivesoftware.smack.SmackException$NoResponseException
at org.jivesoftware.smack.XMPPConnection.throwConnectionExceptionOrNoResponse(XMPP Connection.java:548)
at org.jivesoftware.smack.tcp.XMPPTCPConnection.throwConnectionExceptionOrNoRespon se(XMPPTCPConnection.java:867)
at org.jivesoftware.smack.tcp.PacketReader.startup(PacketReader.java:113)
at org.jivesoftware.smack.tcp.XMPPTCPConnection.initConnection(XMPPTCPConnection.j ava:482)
at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectUsingConfiguration(XMPPTCPC onnection.java:440)
at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectInternal(XMPPTCPConnection. java:811)
at org.jivesoftware.smack.XMPPConnection.connect(XMPPConnection.java:396)
Here are my code snippets:
ConnectionConfiguration config = new ConnectionConfiguration(DOMAIN, 5222);
SASLAuthentication.supportSASLMechanism(“DIGEST-MD5”);
config.setSecurityMode(ConnectionConfiguration.SecurityMode.required);
config.setReconnectionAllowed(false);
config.setSendPresence(true);
config.setRosterLoadedAtLogin(false);
config.setSocketFactory(new MySocketFactory());
config.setLegacySessionDisabled(false);
config.setDebuggerEnabled(true);
trustStore = KeyStore.getInstance(“BKS”);
trustStore.load(context.getResources().openRawResource(R.raw.keystore), password);
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
trustManagerFactory.init(trustStore);
SSLContext sslContext = SSLContext.getInstance(“TLS”);
sslContext.init(null, trustManagerFactory.getTrustManagers(), new SecureRandom());
config.setCustomSSLContext(sslContext);
Here is the debug information for your reference:
SENT (0): <stream:stream to=“server” xmlns=“jabber:client” xmlns:stream=“http://etherx.jabber.org/streams” version=“1.0”>
RCV (0): <?xml version='1.0' encoding='UTF-8'?>
<stream:stream xmlns:stream="[http://etherx.jabber.org/streams](http://etherx.jabber.org/streams)" xmlns="jabber:client" from="server" id="b938aff2" xml:lang="en" version="1.0">
RCV (0): stream:features
DIGEST-MD5
PLAIN
CRAM-MD5
</stream:features>
SENT (0):
RCV (0):
SENT (0): </stream:stream>
Regards,
Jeffrey