content: package com.sast.astbenchmark.service;
  
  import org.apache.http.HttpEntity;
  import org.apache.http.HttpStatus;
  import org.apache.http.client.methods.CloseableHttpResponse;
  import org.apache.http.client.methods.HttpGet;
  import org.apache.http.impl.client.CloseableHttpClient;
  import org.apache.http.impl.client.HttpClients;
  import org.apache.http.util.EntityUtils;
  
  import java.io.IOException;
  
  public class DefaultSsrfClient extends SsrfClient {
  
      @Override
      public void doConnect(String url) {
          CloseableHttpClient httpclient = HttpClients.createDefault();
          HttpGet httpget = new HttpGet(url);
          CloseableHttpResponse response = null;
          try {
              response = httpclient.execute(httpget);
              if (HttpStatus.SC_OK == response.getStatusLine().getStatusCode()) {
                  HttpEntity httpEntity = response.getEntity();
                  String result = EntityUtils.toString(httpEntity, "UTF-8");
                  System.err.println(result);
              }
          } catch (IOException ioe) {
              ioe.printStackTrace();
          } finally {
              try {
                  if (response != null) {
                      response.close();
                  }
              } catch (Exception e) {
              }
              try {
                  if (httpclient != null) {
                      httpclient.close();
                  }
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
      }
  
  }