Buggy code:
public final class KonConnection extends XMPPTCPConnection { private static final Logger LOGGER = Logger . getLogger ( KonConnection . class . getName ( ) ) ; private static final String RESSOURCE = "Kontalk_Desktop" ; private static final boolean ACCEPT_ANY_CERTIFICATE = true ; public KonConnection ( EndpointServer server , PrivateKey privateKey , X509Certificate bridgeCert ) { } private static XMPPTCPConnectionConfiguration buildConfiguration ( String resource , EndpointServer server , PrivateKey privateKey , X509Certificate bridgeCert , boolean acceptAnyCertificate ) { XMPPTCPConnectionConfiguration . XMPPTCPConnectionConfigurationBuilder builder = XMPPTCPConnectionConfiguration . builder ( ) ; builder . setHost ( server . getHost ( ) ) . setPort ( server . getPort ( ) ) . setServiceName ( server . getNetwork ( ) ) . setResource ( resource ) . setUsernameAndPassword ( null , "dummy" ) . setCallbackHandler ( new CallbackHandler ( ) { @ Override public void handle ( Callback [ ] callbacks ) throws IOException , UnsupportedCallbackException { for ( Callback cb : callbacks ) KonConnection . LOGGER . info ( ( "got<seq2seq4repair_space>callback!?:<seq2seq4repair_space>" + cb ) ) ; } <START_BUG> } ) . setRosterLoadedAtLogin ( true ) . setCompressionEnabled ( false ) . setSecurityMode ( required ) . setLegacySessionDisabled ( true ) ; <END_BUG> try { SSLContext ctx = SSLContext . getInstance ( "TLS" ) ; KeyStore keystore = KeyStore . getInstance ( KeyStore . getDefaultType ( ) ) ; keystore . load ( null , null ) ; keystore . setKeyEntry ( "private" , privateKey , new char [ 0 ] , new Certificate [ ] { bridgeCert } ) ; KeyManagerFactory kmFactory = KeyManagerFactory . getInstance ( KeyManagerFactory . getDefaultAlgorithm ( ) ) ; kmFactory . init ( keystore , new char [ 0 ] ) ; KeyManager [ ] km = kmFactory . getKeyManagers ( ) ; SASLAuthentication . blacklistSASLMechanism ( "PLAIN" ) ; TrustManager [ ] tm ; if ( acceptAnyCertificate ) { tm = new TrustManager [ ] { new X509TrustManager ( ) { @ Override public X509Certificate [ ] getAcceptedIssuers ( ) { return null ; } @ Override public void checkServerTrusted ( X509Certificate [ ] chain , String authType ) throws CertificateException { } @ Override public void checkClientTrusted ( X509Certificate [ ] chain , String authType ) throws CertificateException { } } } ; } else { TrustManagerFactory tmFactory = TrustManagerFactory . getInstance ( TrustManagerFactory . getDefaultAlgorithm ( ) ) ; KeyStore ks = KeyStore . getInstance ( KeyStore . getDefaultType ( ) ) ; tmFactory . init ( ks ) ; tm = tmFactory . getTrustManagers ( ) ; } ctx . init ( km , tm , null ) ; builder . setCustomSSLContext ( ctx ) ; } catch ( NoSuchAlgorithmException | KeyStoreException | IOException | CertificateException | UnrecoverableKeyException | KeyManagementException ex ) { KonConnection . LOGGER . log ( Level . WARNING , "can't<seq2seq4repair_space>setup<seq2seq4repair_space>SSL<seq2seq4repair_space>connection" , ex ) ; } return builder . build ( ) ; } @ Override public void disconnect ( ) { } @ Override public synchronized void disconnect ( Presence presence ) { } public String getDestination ( ) { } }

Fix:
} ) . setRosterLoadedAtLogin ( true ) . setCompressionEnabled ( true ) . setSecurityMode ( required ) . setLegacySessionDisabled ( true ) ;