Project

General

Profile

Tigase Android Messenger run with Tigase server,Tigase Android Messenger cause a exception

ll chen
Added over 4 years ago

I download server source from https://repository.tigase.org/git/tigase-server.git and download the Tigase Android Messenger source form https://repository.tigase.org/git/tigase-mobilemessenger.git.

my server config's file is:

config-type=--gen-config-def
--admins=tigase@192.168.3.130
--user-db=mysql
--virt-hosts=192.168.3.130
--debug=server
--user-repo-pool-size=12
--debug=server,xmpp.impl,xmpp.XMPPIOService
--debug-packages=tigase
--user-db-uri=jdbc:mysql://127.0.0.1:3306/tigase?user=tigase&password=tigase&useUnicode=true&characterEncoding=UTF-8&autoCreateUser=true
--sm-plugins =message-archive-xep-0136,+message-all,+jabber:iq:auth,+urn:ietf:params:xml:ns:xmpp-sasl,+urn:ietf:params:xml:ns:xmpp-bind,+urn:ietf:params:xml:ns:xmpp-session,+jabber:iq:register=2,+jabber:iq:roster,+presence,+jabber:iq:privacy,+jabber:iq:version,+http://jabber.org/protocol/stats,+starttls,+msgoffline,+vcard-temp,+http://jabber.org/protocol/commands,+jabber:iq:private,+urn:xmpp:ping,+basic-filter,+domain-filter,+pep,+zlib
sess-man/plugins-conf/message-archive-xep-0136/component-jid=message-archive@chenll
sess-man/plugins-conf/message-archive-xep-0136/auto=true
--comp-name-1=message-archive
--comp-class-1=tigase.archive.MessageArchiveComponent
message-archive/archive-repo-uri=jdbc:mysql://127.0.0.1:3306/tigase?user=tigase&password=tigase&useUnicode=true&characterEncoding=UTF-8&autoCreateUser=true

my server's log is the server.log file,and Android App's log is the app.log

The exception is:

09-22 11:54:20.556: I/Jaxmpp(4691): Using SocketConnector
09-22 11:54:20.556: I/SocketConnector(4691): Using XEP-0077 mode!!!!
09-22 11:54:20.576: I/SocketConnector(4691): Resolving SRV recrd of domain '192.168.3.130'
09-22 11:54:20.581: I/SocketConnector(4691): Opening connection to /192.168.3.130:5222
09-22 11:54:21.076: E/SocketConnector(4691): Can't establish encrypted connection
09-22 11:54:21.076: E/SocketConnector(4691): javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
09-22 11:54:21.076: E/SocketConnector(4691):    at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:381)
09-22 11:54:21.076: E/SocketConnector(4691):    at tigase.jaxmpp.j2se.connectors.socket.SocketConnector.proceedTLS(SocketConnector.java:664)
09-22 11:54:21.076: E/SocketConnector(4691):    at tigase.jaxmpp.j2se.connectors.socket.SocketConnector.onTLSStanza(SocketConnector.java:586)
09-22 11:54:21.076: E/SocketConnector(4691):    at tigase.jaxmpp.j2se.connectors.socket.SocketConnector.processElement(SocketConnector.java:765)
09-22 11:54:21.076: E/SocketConnector(4691):    at tigase.jaxmpp.j2se.connectors.socket.SocketConnector$Worker$1.nextElement(SocketConnector.java:240)
09-22 11:54:21.076: E/SocketConnector(4691):    at tigase.jaxmpp.j2se.connectors.socket.XMPPDomBuilderHandler.endElement(XMPPDomBuilderHandler.java:152)
09-22 11:54:21.076: E/SocketConnector(4691):    at tigase.xml.SimpleParser.parse(SimpleParser.java:323)
09-22 11:54:21.076: E/SocketConnector(4691):    at tigase.jaxmpp.j2se.connectors.socket.SocketConnector$Worker.run(SocketConnector.java:286)
09-22 11:54:21.076: E/SocketConnector(4691): Caused by: org.tigase.mobile.security.SecureTrustManagerFactory$DataCertificateException: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
09-22 11:54:21.076: E/SocketConnector(4691):    at org.tigase.mobile.security.SecureTrustManagerFactory$TrustManagerWrapper.checkServerTrusted(SecureTrustManagerFactory.java:85)
09-22 11:54:21.076: E/SocketConnector(4691):    at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.verifyCertificateChain(OpenSSLSocketImpl.java:599)
09-22 11:54:21.076: E/SocketConnector(4691):    at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_do_handshake(Native Method)
09-22 11:54:21.076: E/SocketConnector(4691):    at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:378)
09-22 11:54:21.076: E/SocketConnector(4691):    ... 7 more
09-22 11:54:21.076: E/SocketConnector(4691): Caused by: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
09-22 11:54:21.076: E/SocketConnector(4691):    at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:276)
09-22 11:54:21.076: E/SocketConnector(4691):    at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:187)
09-22 11:54:21.076: E/SocketConnector(4691):    at org.tigase.mobile.security.SecureTrustManagerFactory$TrustManagerWrapper.checkServerTrusted(SecureTrustManagerFactory.java:83)
09-22 11:54:21.076: E/SocketConnector(4691):    ... 10 more
09-22 11:54:21.076: E/SocketConnector(4691): Caused by: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
09-22 11:54:21.076: E/SocketConnector(4691):    ... 13 more
09-22 11:54:21.096: I/AuthenticatorActivity(4691): onAuthenticationResult(false)
09-22 11:54:21.116: E/AuthenticatorActivity(4691): onAuthenticationResult: failed to authenticate
09-22 11:54:21.251: E/ViewRootImpl(4691): sendUserActionEvent() mView == null
09-22 11:55:06.911: W/IInputConnectionWrapper(4691): showStatusIcon on inactive InputConnection
server.log (84.4 KB) server.log
app.log (3.87 KB) app.log

Replies (2)

Added by Wojciech Kapcia TigaseTeam over 4 years ago

Most likely you are attempting to connect to the Tigase while using it's auto-generated self-signed certificate. Please peruse Common Problems Verifying Server Certificates from Android documentation.

Added by ll chen over 4 years ago

in org.tigase.mobile.authenticator.AuthenticatorActivity.UserCreateAccountTask.doInBackground method,I add code at 125 line like below:

                contact.addListener(Connector.Error,
                    new Listener<ConnectorEvent>() {
                        @Override
                        public void handleEvent(ConnectorEvent be)
                                throws JaxmppException {
                            if (be.getType() == Connector.Error
                                    && be.getCaught() != null) {
                                Throwable throwable = extractCauseException(be
                                        .getCaught());
                                if (throwable instanceof SecureTrustManagerFactory.DataCertificateException) {
                                    certException = (DataCertificateException) throwable;
                                    data.put("account", contact
                                            .getSessionObject()
                                            .getUserBareJid().toString());

                                }
                            }
                        }
                    });

and fix this problem.

1.bmp (2.33 MB) 1.bmp

    (1-2/2)