String proxyPass = System.getProperty("http.proxyPassword", "");
Message.debug("authenicating to proxy server with username [" + proxyUser + "]");
result = new PasswordAuthentication(proxyUser, proxyPass.toCharArray());
}
} else {
Credentials c = CredentialsStore.INSTANCE.getCredentials(getRequestingPrompt(),
getRequestingHost());
Message.debug("authentication: k='"
+ Credentials.buildKey(getRequestingPrompt(), getRequestingHost()) + "' c='"
+ c + "'");
if (c != null) {
final String password = c.getPasswd() == null ? "" : c.getPasswd();
result = new PasswordAuthentication(c.getUserName(), password.toCharArray());
}
}
if ((result == null) && (original != null)) {
Authenticator.setDefault(original);