powered by Jive Software

SSLHandshakeException

When I wanted to connect tigase through smack, he reported this exception to me. Below is my code

        XMPPTCPConnection xmppConn;
        logger.info("Initiating connection ...");
        XMPPTCPConnection.setUseStreamManagementResumptionDefault(true);
        XMPPTCPConnection.setUseStreamManagementDefault(true);

        SmackConfiguration.DEBUG = debuggable;

        final XMPPTCPConnectionConfiguration.Builder config = XMPPTCPConnectionConfiguration.builder();
        logger.info("Connecting to the server ...");
        config.setXmppDomain("activate.navicat.com");
        config.setHost("192.168.0.24");
        config.setPort(5222);
        config.setSecurityMode(ConnectionConfiguration.SecurityMode.ifpossible);
        config.setCompressionEnabled(true);
        config.setSendPresence(false);
        Resourcepart mResourcepart = Resourcepart.fromOrThrowUnchecked("java");
        config.setResource(mResourcepart);

        xmppConn = new XMPPTCPConnection(config.build()); // Create the connection

        xmppConn.connect(); // Connect
        if (xmppConn.isConnected()) {
            System.err.println("conn...");
            xmppConn.login("test11","123456");
            System.err.println("login...");
            xmppConn.disconnect();
        }

Does your server present a valid TLS certificate?
There should be more information in the stracktrace, describing the cause of the exception.

1 Like

Is there any particular reason you’re using compression? In today’s world, there aren’t really any benefits to using that - and I recall that under circumstances, it could even be used maliciously.