code: public HttpURLConnection createHttpURLConnection(URL url, boolean proxy) throws URLConnectionFailureException {
          if (proxy) {
              return createHttpURLConnection(url);
          }
          HttpURLConnection conn = null;
          try {
              conn = (HttpURLConnection) url.openConnection();
              final int timeout = settings.getInt(Settings.KEYS.CONNECTION_TIMEOUT, 10000);
              conn.setConnectTimeout(timeout);
              conn.setInstanceFollowRedirects(true);
          } catch (IOException ioe) {
              throw new URLConnectionFailureException("Error getting connection.", ioe);
          }
          configureTLS(url, conn);
          return conn;
      }
docs: Utility method to create an HttpURLConnection. The use of a proxy here is
  optional as there may be cases where a proxy is configured but we don't
  want to use it (for example, if there's an internal repository
  configured)
  
  @param url the URL to connect to
  @param proxy whether to use the proxy (if configured)
  @return a newly constructed HttpURLConnection
  @throws org.owasp.dependencycheck.utils.URLConnectionFailureException
  thrown if there is an exception