Program: 29732
Project: 29732
Buggy source:
protected void clientSSLSetup(Context ctx,Boolean ignoreSSLHostname,Boolean ignoreCertTrust){
  if (ignoreSSLHostname) {
    clientBuilder.hostnameVerifier(new HostnameVerifier(){
      @Override public boolean verify(      String hostname,      SSLSession session){
        return true;
      }
    }
);
  }
  X509TrustManager x509TrustManager=null;
  if (ignoreCertTrust) {
    x509TrustManager=new X509TrustManager(){
      @Override public void checkClientTrusted(      java.security.cert.X509Certificate[] chain,      String authType) throws CertificateException {
      }
      @Override public void checkServerTrusted(      java.security.cert.X509Certificate[] chain,      String authType) throws CertificateException {
      }
      @Override public java.security.cert.X509Certificate[] getAcceptedIssuers(){
        return new java.security.cert.X509Certificate[]{};
      }
    }
;
  }
 else {
    try {
      TrustManagerFactory trustManagerFactory=TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
      trustManagerFactory.init((KeyStore)null);
      TrustManager[] trustManagers=trustManagerFactory.getTrustManagers();
      for (      TrustManager trustManager : trustManagers) {
        if (trustManager instanceof X509TrustManager) {
          x509TrustManager=(X509TrustManager)trustManager;
          break;
        }
      }
    }
 catch (    Exception e) {
      Log.d(TAG,"String_Node_Str",e);
    }
  }
  try {
    final SSLContext sslContext=SSLContext.getInstance("String_Node_Str");
    sslContext.init(MyKeyManager.getInstance(ctx),new TrustManager[]{x509TrustManager},new java.security.SecureRandom());
    final SSLSocketFactory sslSocketFactory=sslContext.getSocketFactory();
    clientBuilder.sslSocketFactory(sslSocketFactory,x509TrustManager);
  }
 catch (  Exception e) {
    Log.d(TAG,"String_Node_Str",e);
  }
  client=clientBuilder.build();
}

Fixed version (ground truth):
protected void clientSSLSetup(Context ctx,Boolean ignoreSSLHostname,Boolean ignoreCertTrust){
  if (ignoreSSLHostname) {
    clientBuilder.hostnameVerifier(new HostnameVerifier(){
      @SuppressLint("String_Node_Str") @Override public boolean verify(      String hostname,      SSLSession session){
        return true;
      }
    }
);
  }
  X509TrustManager x509TrustManager=null;
  if (ignoreCertTrust) {
    x509TrustManager=new X509TrustManager(){
      @Override public void checkClientTrusted(      java.security.cert.X509Certificate[] chain,      String authType) throws CertificateException {
      }
      @Override public void checkServerTrusted(      java.security.cert.X509Certificate[] chain,      String authType) throws CertificateException {
      }
      @Override public java.security.cert.X509Certificate[] getAcceptedIssuers(){
        return new java.security.cert.X509Certificate[]{};
      }
    }
;
  }
 else {
    try {
      TrustManagerFactory trustManagerFactory=TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
      trustManagerFactory.init((KeyStore)null);
      TrustManager[] trustManagers=trustManagerFactory.getTrustManagers();
      for (      TrustManager trustManager : trustManagers) {
        if (trustManager instanceof X509TrustManager) {
          x509TrustManager=(X509TrustManager)trustManager;
          break;
        }
      }
    }
 catch (    Exception e) {
      Log.d(TAG,"String_Node_Str",e);
    }
  }
  try {
    final SSLContext sslContext=SSLContext.getInstance("String_Node_Str");
    sslContext.init(MyKeyManager.getInstance(ctx),new TrustManager[]{x509TrustManager},new java.security.SecureRandom());
    final SSLSocketFactory sslSocketFactory=sslContext.getSocketFactory();
    clientBuilder.sslSocketFactory(sslSocketFactory,x509TrustManager);
  }
 catch (  Exception e) {
    Log.d(TAG,"String_Node_Str",e);
  }
  client=clientBuilder.build();
}