private static PasswordAuthentication getSystemCreds(
     final AuthScope authscope, final Authenticator.RequestorType requestorType) {
   final String hostname = authscope.getHost();
   final int port = authscope.getPort();
   final String protocol = port == 443 ? "https" : "http";
   return Authenticator.requestPasswordAuthentication(
       hostname,
       null,
       port,
       protocol,
       null,
       translateScheme(authscope.getScheme()),
       null,
       requestorType);
 }