Java Smack XMPP client 4.2.4 why it works "bad-auth/"?

Hi all, I'm a beginner and found this code a jabber client:
package jabberIL;

 import java.io.IOException;
 import java.io.BufferedReader;
 import java.io.An InputStreamReader is;
 import java.lang.InterruptedException;
 import java.net.InetAddress;
 import javax.net.ssl.HostnameVerifier;
 import javax.net.ssl.SSLSession;
 import org.jivesoftware.smack.ConnectionConfiguration;
 import org.jxmpp.jid.DomainBareJid;
 import org.jxmpp.jid.EntityBareJid;
 import org.jxmpp.jid.impl.JidCreate;
 import org.jxmpp.stringprep.XmppStringprepException;
 import org.jivesoftware.smack.tcp.XMPPTCPConnection;
 import org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration;
 import org.jivesoftware.smack.SmackException;
 import org.jivesoftware.smack.XMPPException;
 import org.jivesoftware.smack.AbstractXMPPConnection;
 import org.jivesoftware.smack.packet.Message;
 import org.jivesoftware.smack.chat2.ChatManager;
 import org.jivesoftware.smack.chat2.Chat;
 import org.jivesoftware.smack.chat2.IncomingChatMessageListener;

 public class JabberIL { 
 public static void main(String[] args) throws XmppStringprepException, SmackException, XMPPException, IOException, InterruptedException {
 String msg;
 BufferedReader br = new BufferedReader(new an InputStreamReader(System.in));

 InetAddress addr = InetAddress.getByName("ip_server"); 
 HostnameVerifier verifier = new HostnameVerifier() {
 public boolean verify(String hostname, SSLSession session) {
 return false; // false 
}
};

 DomainBareJid serviceName = JidCreate.domainBareFrom("name_server.ru"); 
 XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder() 
 .setUsernameAndPassword("name","pass") 
.setPort(5222)
.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled)
.setXmppDomain(serviceName)
 .setHostnameVerifier(verifier) 
.setHostAddress(addr)
 .setDebuggerEnabled(true) 
.setSendPresence(true)
.build();
 AbstractXMPPConnection conn1 = new XMPPTCPConnection(config); 

conn1.connect();
if(conn1.isConnected()){
 System.out.println("XMPP Connected");
 } 

 conn1.login(); 

 ChatManager chatManager = ChatManager.getInstanceFor(conn1); 
 chatManager.addIncomingListener(new IncomingChatMessageListener() {
 public void newIncomingMessage(EntityBareJid from, Message, message, Chat Chat) { 
 System.out.println("Received message:" + message.getBody());
}
});
 Chat Chat = chatManager.chatWith(JidCreate.entityBareFrom("to_name@server.ru"));
 while (!(msg = br.readLine()).equals("bye")) {
chat.send(msg);
 } 
 //conn1.disconnect(); 
}
 }


It works for example when connecting to jabber.ru (connect, receive, send messages). But when I try to connect to my local jabber server in the corporate network, it turns out this error , I attach the full backtrace:
08:50:22 SENT (0): <stream:stream xmlns="jabber:client" to="server_name" xmlns:st ream="http://etherx.jabber.org/streams" version="1.0" from="jbot@server_name" xml :lang="en">
08:50:22 RECV (0): <?xml version='1.0'?><stream:stream xmlns="jabber:client" xml ns:stream="http://etherx.jabber.org/streams" id="3533088839" from="server_name" 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>P
LAIN</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms><register xmlns="http://jabber.org/features/iq-register">
XMPP Connected
08:50:22 SENT (0): <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="SCR
AM-SHA-1">biwsbj1qYm90LHI9U1d4bzZqXDt2dFlZdhhlajp7wmurmwtwzihcctzwjgm=</auth>
08:50:22 RECV (0): <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cj1TV3hvN
mpcO3Z0WVl0eGVqOntaZSsxa3BmKEJxNlyky2namvvusjvwejbczwtpzzrebgxxnwc9psxzpww3vnbos
kk1MGMzZVBLdUl2U2FnY0E9PSxpPTQwOty=</challenge>
08:50:22 SENT (0): <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">Yz1iaXdzLH
I9U1d4bzZqXDt2dFlZdHhlajp7WmUrMWtwzihcctzwjgnjwjfvbko1chowqmvrt2c0rgxsctvnpt0scd
1TUWNNTGJORHB6NnFUVi84K2s3M09McFrrstg9</response>
08:50:22 RECV (0): <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><bad-auth>
</bad-auth></failure>
W■s 19, 2018 8:50:22 AM org.jivesoftware.smack.sasl.SASLError fromString
WARNING: Could not transform string 'bad_auth' to SASLError
java.lang.IllegalArgumentException: No enum constant org.jivesoftware.smack.sasl
.SASLError.bad_auth
 at java.lang.Enum.valueOf(Enum.java:238)
 at org.jivesoftware.smack.sasl.SASLError.valueOf(SASLError.java:27)
 at org.jivesoftware.smack.sasl.SASLError.fromString(SASLError.java:51)
 at org.jivesoftware.smack.sasl.packet.SaslStreamElements$SASLFailure.<in it>(SaslStreamElements.java:209)
 at org.jivesoftware.smack.util.PacketParserUtils.parseSASLFailure(Packet
ParserUtils.java:797)
 at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePacket
s(XMPPTCPConnection.java:1099)
 at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(
XMPPTCPConnection.java:1000)
 at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPT
CPConnection.java:1016)
 at java.lang.Thread.run(of the Thread.java:748)

Exception in thread "main" org.jivesoftware.smack.sasl.SASLErrorException: SASLE
rror using SCRAM-SHA-1: bad-auth
 at org.jivesoftware.smack.SASLAuthentication.authenticationFailed(SASLAu
thentication.java:292)
 at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePacket
s(XMPPTCPConnection.java:1100)
 at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(
XMPPTCPConnection.java:1000)
 at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPT
CPConnection.java:1016)
 at java.lang.Thread.run(Thread.java:748)</in></register></starttls></stream:features></stream:stream></stream:stream>


When I take for example, the client Wime he is also connected to jabber.ru no problem, but when I connect to my local server , it turns out the warning about self-signed certificate with a question to accept to reject it. It is possible that the problem of falling for my client ? or not? I understand that the issue is probably trivial, but I have a bad understanding of the processes )))

P. S. the network has found a piece of code , which as I understand makes simply ignore that there is a certificate from the server. Although I'm not sure in his faithfulness. It is inserted into my program (the pieces in the appropriate places):
import jabberIL.X509_Trust_Manager;
import javax.net.ssl.SSLContext;
import java.security.SecureRandom;
import javax.net.ssl.TrustManager;

Cur_SSL_Context SSLContext = null;
 try {
 Cur_SSL_Context = SSLContext.getInstance("TLS");
 Cur_SSL_Context.init(null, new TrustManager[] { new X509_Trust_Manager() }, new SecureRandom());
 } catch (Exception e) {
e.printStackTrace();
}

 .setSocketFactory(Cur_SSL_Context.getSocketFactory())


And he implementierung class X509_Trust_Manager
package jabberIL;

import javax.net.ssl.X509TrustManager;
import java.security.cert.X509Certificate;
import java.security.cert.CertificateException; 

public class X509_Trust_Manager implements X509TrustManager {

 public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { 
}

 public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { 
}

 public X509Certificate[] getAcceptedIssuers() {
 return null;
}
}


But in this case, my program crash with a timeout error:
Exception in thread "main" org.jivesoftware.smack.SmackException$NoResponseExcep tion: No response received within reply timeout. Was 5000ms Timeout (~5s). While waiting for establishing TLS
June 3rd 19 at 19:25
0 answer

Find more questions by tags XMPPJava