[FIXED JENKINS-54903] Ensure the authenticator is created on load path also

This commit is contained in:
Stephen Connolly committed 2018-12-04 13:32:12 +00:00
1 parent 055b913a75
commit be08867788
1 file changed
+6 -1
@@ -134,7 +134,11 @@ public final class ProxyConfiguration extends AbstractDescribableImpl<ProxyConfi
this.secretPassword = Secret.fromString(password);
this.noProxyHost = Util.fixEmptyAndTrim(noProxyHost);
this.testUrl = Util.fixEmptyAndTrim(testUrl);
authenticator = new Authenticator() {
authenticator = newAuthenticator();
}
private Authenticator newAuthenticator() {
return new Authenticator() {
@Override
public PasswordAuthentication getPasswordAuthentication() {
String userName = getUserName();
@@ -223,6 +227,7 @@ public final class ProxyConfiguration extends AbstractDescribableImpl<ProxyConfi
// backward compatibility : get scrambled password and store it encrypted
secretPassword = Secret.fromString(Scrambler.descramble(password));
password = null;
authenticator = newAuthenticator();
return this;
}