AnsweredAssumed Answered

SSLHandshakeException on connection

Question asked by gfg on Oct 24, 2014
Latest reply on Jul 15, 2015 by Dan Devine

I'm trying to implement Smack 4.1 in my android app to communicate witch my ejabberd server, during the connection i get the following exception

 

10-24 16:30:55.479  21033-21070/com.demo.xmppchat D/dalvikvm﹕ GC_FOR_ALLOC freed 370K, 3% free 17153K/17556K, paused 10ms, total 10ms

10-24 16:30:55.489  21033-21070/com.demo.xmppchat D/SMACK﹕ SENT (0): <stream:stream xmlns='jabber:client' to='178.62.199.13' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>

10-24 16:30:55.559  21033-21071/com.demo.xmppchat D/SMACK﹕ RCV (0): <?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='3386981479' from='178.62.199.13' version='1.0' xml:lang='en'><stream:features><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>SCRAM-SHA-1</mechanism><mec hanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism></mechanisms><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='TQ2JFyRoSa70h2G1bpgjzuXb2sU='/><register xmlns='http://jabber.org/features/iq-register'/></stream:features>

10-24 16:30:55.559  21033-21070/com.demo.xmppchat D/SMACK﹕ SENT (0): <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'></starttls>

10-24 16:30:55.629  21033-21071/com.demo.xmppchat D/SMACK﹕ RCV (0): <proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>

10-24 16:30:55.769  21033-21071/com.demo.xmppchat W/AbstractXMPPConnection﹕ Connection closed with error

    javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

            at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.ja va:409)

            at com.android.org.conscrypt.OpenSSLSocketImpl$SSLInputStream.<init>(OpenSSLSocket Impl.java:661)

            at com.android.org.conscrypt.OpenSSLSocketImpl.getInputStream(OpenSSLSocketImpl.ja va:632)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection.initReaderAndWriter(XMPPTCPConnect ion.java:661)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection.proceedTLSReceived(XMPPTCPConnecti on.java:768)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection.access$1000(XMPPTCPConnection.java :132)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPC onnection.java:1068)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$200(XMPPTCPCon nection.java:969)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnecti on.java:988)

     Caused by: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

            at com.android.org.conscrypt.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:2 82)

            at com.android.org.conscrypt.TrustManagerImpl.checkServerTrusted(TrustManagerImpl. java:202)

            at com.android.org.conscrypt.OpenSSLSocketImpl.verifyCertificateChain(OpenSSLSocke tImpl.java:611)

            at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)

            at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.ja va:405)

            at com.android.org.conscrypt.OpenSSLSocketImpl$SSLInputStream.<init>(OpenSSLSocket Impl.java:661)

            at com.android.org.conscrypt.OpenSSLSocketImpl.getInputStream(OpenSSLSocketImpl.ja va:632)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection.initReaderAndWriter(XMPPTCPConnect ion.java:661)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection.proceedTLSReceived(XMPPTCPConnecti on.java:768)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection.access$1000(XMPPTCPConnection.java :132)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPC onnection.java:1068)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$200(XMPPTCPCon nection.java:969)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnecti on.java:988)

     Caused by: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

            at com.android.org.conscrypt.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:2 82)

            at com.android.org.conscrypt.TrustManagerImpl.checkServerTrusted(TrustManagerImpl. java:202)

            at com.android.org.conscrypt.OpenSSLSocketImpl.verifyCertificateChain(OpenSSLSocke tImpl.java:611)

            at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)

            at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.ja va:405)

            at com.android.org.conscrypt.OpenSSLSocketImpl$SSLInputStream.<init>(OpenSSLSocket Impl.java:661)

            at com.android.org.conscrypt.OpenSSLSocketImpl.getInputStream(OpenSSLSocketImpl.ja va:632)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection.initReaderAndWriter(XMPPTCPConnect ion.java:661)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection.proceedTLSReceived(XMPPTCPConnecti on.java:768)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection.access$1000(XMPPTCPConnection.java :132)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPC onnection.java:1068)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$200(XMPPTCPCon nection.java:969)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnecti on.java:988)

10-24 16:30:55.769  21033-21071/com.demo.xmppchat D/Connection﹕ Closed On error

10-24 16:30:55.779  21033-21071/com.demo.xmppchat W/System.err﹕ javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

10-24 16:30:55.779  21033-21071/com.demo.xmppchat W/System.err﹕ at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.ja va:409)

10-24 16:30:55.779  21033-21071/com.demo.xmppchat W/System.err﹕ at com.android.org.conscrypt.OpenSSLSocketImpl$SSLInputStream.<init>(OpenSSLSocket Impl.java:661)

10-24 16:30:55.779  21033-21071/com.demo.xmppchat W/System.err﹕ at com.android.org.conscrypt.OpenSSLSocketImpl.getInputStream(OpenSSLSocketImpl.ja va:632)

10-24 16:30:55.779  21033-21071/com.demo.xmppchat W/System.err﹕ at org.jivesoftware.smack.tcp.XMPPTCPConnection.initReaderAndWriter(XMPPTCPConnect ion.java:661)

10-24 16:30:55.779  21033-21071/com.demo.xmppchat W/System.err﹕ at org.jivesoftware.smack.tcp.XMPPTCPConnection.proceedTLSReceived(XMPPTCPConnecti on.java:768)

10-24 16:30:55.779  21033-21071/com.demo.xmppchat W/System.err﹕ at org.jivesoftware.smack.tcp.XMPPTCPConnection.access$1000(XMPPTCPConnection.java :132)

10-24 16:30:55.779  21033-21071/com.demo.xmppchat W/System.err﹕ at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPC onnection.java:1068)

10-24 16:30:55.779  21033-21071/com.demo.xmppchat W/System.err﹕ at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$200(XMPPTCPCon nection.java:969)

10-24 16:30:55.779  21033-21071/com.demo.xmppchat W/System.err﹕ at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnecti on.java:988)

10-24 16:30:55.779  21033-21071/com.demo.xmppchat W/System.err﹕ Caused by: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

10-24 16:30:55.779  21033-21071/com.demo.xmppchat W/System.err﹕ at com.android.org.conscrypt.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:2 82)

10-24 16:30:55.779  21033-21071/com.demo.xmppchat W/System.err﹕ at com.android.org.conscrypt.TrustManagerImpl.checkServerTrusted(TrustManagerImpl. java:202)

10-24 16:30:55.779  21033-21071/com.demo.xmppchat W/System.err﹕ at com.android.org.conscrypt.OpenSSLSocketImpl.verifyCertificateChain(OpenSSLSocke tImpl.java:611)

10-24 16:30:55.779  21033-21071/com.demo.xmppchat W/System.err﹕ at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)

10-24 16:30:55.779  21033-21071/com.demo.xmppchat W/System.err﹕ at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.ja va:405)

10-24 16:30:55.779  21033-21071/com.demo.xmppchat W/System.err﹕ ... 8 more

10-24 16:30:55.779  21033-21071/com.demo.xmppchat W/System.err﹕ Caused by: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

 

Could somebody help me?

Outcomes