Program: 58677
Project: 58677
Buggy source:
/** 
 * Sends the request contained in the <code>ContentFactory</code>. The <code>ContentFactory</code> will deliver the request as an <code>InputStream</code>.
 * @param request the ebics request
 * @return the HTTP return code
 */
public final int send(ContentFactory request) throws IOException {
  HttpClient httpClient;
  String proxyConfiguration;
  PostMethod method;
  RequestEntity requestEntity;
  InputStream input;
  int retCode;
  httpClient=new HttpClient();
  proxyConfiguration=AppSettings.get().get("String_Node_Str");
  if (proxyConfiguration != null && !proxyConfiguration.equals("String_Node_Str")) {
    HostConfiguration hostConfig;
    String proxyHost;
    int proxyPort;
    hostConfig=httpClient.getHostConfiguration();
    proxyHost=AppSettings.get().get("String_Node_Str").trim();
    proxyPort=Integer.parseInt(AppSettings.get().get("String_Node_Str").trim());
    hostConfig.setProxy(proxyHost,proxyPort);
    if (!AppSettings.get().get("String_Node_Str").equals("String_Node_Str")) {
      String user;
      String pwd;
      UsernamePasswordCredentials credentials;
      AuthScope authscope;
      user=AppSettings.get().get("String_Node_Str").trim();
      pwd=AppSettings.get().get("String_Node_Str").trim();
      credentials=new UsernamePasswordCredentials(user,pwd);
      authscope=new AuthScope(proxyHost,proxyPort);
      httpClient.getState().setProxyCredentials(authscope,credentials);
    }
  }
  input=request.getContent();
  method=new PostMethod(session.getUser().getEbicsPartner().getEbicsBank().getUrl());
  method.getParams().setSoTimeout(30000);
  requestEntity=new InputStreamRequestEntity(input);
  method.setRequestEntity(requestEntity);
  method.setRequestHeader("String_Node_Str","String_Node_Str");
  retCode=-1;
  retCode=httpClient.executeMethod(method);
  response=new InputStreamContentFactory(method.getResponseBodyAsStream());
  return retCode;
}

Fixed version (ground truth):
/** 
 * Sends the request contained in the <code>ContentFactory</code>. The <code>ContentFactory</code> will deliver the request as an <code>InputStream</code>.
 * @param request the ebics request
 * @return the HTTP return code
 * @throws AxelorException 
 */
public final int send(ContentFactory request,File certFile) throws IOException, AxelorException {
  HttpClient httpClient;
  String proxyConfiguration;
  PostMethod method;
  RequestEntity requestEntity;
  InputStream input;
  int retCode;
  httpClient=new HttpClient();
  DefaultHttpClient client=getSecuredHttpClient(certFile);
  proxyConfiguration=AppSettings.get().get("String_Node_Str");
  if (proxyConfiguration != null && !proxyConfiguration.equals("String_Node_Str")) {
    HostConfiguration hostConfig;
    String proxyHost;
    int proxyPort;
    hostConfig=httpClient.getHostConfiguration();
    proxyHost=AppSettings.get().get("String_Node_Str").trim();
    proxyPort=Integer.parseInt(AppSettings.get().get("String_Node_Str").trim());
    hostConfig.setProxy(proxyHost,proxyPort);
    if (!AppSettings.get().get("String_Node_Str").equals("String_Node_Str")) {
      String user;
      String pwd;
      UsernamePasswordCredentials credentials;
      AuthScope authscope;
      user=AppSettings.get().get("String_Node_Str").trim();
      pwd=AppSettings.get().get("String_Node_Str").trim();
      credentials=new UsernamePasswordCredentials(user,pwd);
      authscope=new AuthScope(proxyHost,proxyPort);
      httpClient.getState().setProxyCredentials(authscope,credentials);
    }
  }
  input=request.getContent();
  method=new PostMethod(session.getUser().getEbicsPartner().getEbicsBank().getUrl());
  method.getParams().setSoTimeout(30000);
  requestEntity=new InputStreamRequestEntity(input);
  method.setRequestEntity(requestEntity);
  method.setRequestHeader("String_Node_Str","String_Node_Str");
  retCode=-1;
  HttpPost post=new HttpPost("String_Node_Str");
  ContentType type=ContentType.TEXT_XML;
  HttpEntity entity=new InputStreamEntity(input,retCode,type);
  post.setEntity(entity);
  HttpResponse responseHttp=client.execute(post);
  retCode=responseHttp.getStatusLine().getStatusCode();
  response=new InputStreamContentFactory(responseHttp.getEntity().getContent());
  return retCode;
}