String me = args.length > 0 ? args[0] : "user1";
String to = args.length < 2 ? null : args[1];
try {
ConnectionConfiguration connectionConfiguration = new ConnectionConfiguration("localhost");
// ConnectionConfiguration connectionConfiguration = new ConnectionConfiguration("xmpp.eu");
connectionConfiguration.setCompressionEnabled(false);
connectionConfiguration.setSelfSignedCertificateEnabled(true);
connectionConfiguration.setExpiredCertificatesCheckEnabled(false);
connectionConfiguration.setDebuggerEnabled(true);
connectionConfiguration.setSASLAuthenticationEnabled(true);
connectionConfiguration.setSecurityMode(ConnectionConfiguration.SecurityMode.required);
XMPPConnection.DEBUG_ENABLED = true;
XMPPConnection connection = new XMPPConnection(connectionConfiguration);
connection.connect();
SASLAuthentication saslAuthentication = connection.getSASLAuthentication();