code: private Optional<String> tryGerritHttpAuth(HttpClientBuilder client, HttpContext httpContext) throws IOException, HttpStatusException {
          String loginUrl = authData.getHost() + "/login/";
          HttpResponse loginResponse = httpRequestExecutor.execute(client, new HttpGet(loginUrl), httpContext);
          return extractGerritAuth(loginResponse);
      }
docs: Try to authenticate against Gerrit instances with HTTP auth (not OAuth or something like that).
  In case of success we get a GerritAccount cookie. In that case no more login credentials need to be sent as
  long as we use the *same* HTTP client. Even requests against authenticated rest api (/a) will be processed
  with the GerritAccount cookie.
  
  This is a workaround for "double" HTTP authentication (i.e. reverse proxy *and* Gerrit do HTTP authentication
  for rest api (/a)).
  
  Following old notes from README about the issue:
  If you have correctly set up a HTTP Password in Gerrit, but still have authentication issues, your Gerrit instance
  might be behind a HTTP Reverse Proxy (like Nginx or Apache) with enabled HTTP Authentication. You can identify that if
  you have to enter an username and password (browser password request) for opening the Gerrit web interface. Since this
  plugin uses Gerrit REST API (with authentication enabled), you need to tell your system administrator that he should
  disable HTTP Authentication for any request to <code>/a</code> path (e.g. https://git.example.com/a). For these requests
  HTTP Authentication is done by Gerrit (double HTTP Authentication will not work). For more information see
  [Gerrit documentation].
  [Gerrit documentation]: https://gerrit-review.googlesource.com/Documentation/rest-api.html#authentication