Program: 80685
Project: 80685
Buggy source:
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,"String_Node_Str").setCallbackHandler(new CallbackHandler(){
    @Override public void handle(    Callback[] callbacks) throws IOException, UnsupportedCallbackException {
      for (      Callback cb : callbacks)       LOGGER.info("String_Node_Str" + cb);
    }
  }
).setRosterLoadedAtLogin(true).setCompressionEnabled(true).setSecurityMode(SecurityMode.required).setLegacySessionDisabled(true);
  try {
    SSLContext ctx=SSLContext.getInstance("String_Node_Str");
    KeyStore keystore=KeyStore.getInstance(KeyStore.getDefaultType());
    keystore.load(null,null);
    keystore.setKeyEntry("String_Node_Str",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("String_Node_Str");
    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) {
    LOGGER.log(Level.WARNING,"String_Node_Str",ex);
  }
  return builder.build();
}

Fixed version (ground truth):
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,"String_Node_Str").setCallbackHandler(new CallbackHandler(){
    @Override public void handle(    Callback[] callbacks) throws IOException, UnsupportedCallbackException {
      for (      Callback cb : callbacks)       LOGGER.info("String_Node_Str" + cb);
    }
  }
).setRosterLoadedAtLogin(true).setCompressionEnabled(false).setSecurityMode(SecurityMode.required).setLegacySessionDisabled(true);
  try {
    SSLContext ctx=SSLContext.getInstance("String_Node_Str");
    KeyStore keystore=KeyStore.getInstance(KeyStore.getDefaultType());
    keystore.load(null,null);
    keystore.setKeyEntry("String_Node_Str",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("String_Node_Str");
    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) {
    LOGGER.log(Level.WARNING,"String_Node_Str",ex);
  }
  return builder.build();
}