X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fbin%2FCache.java;fp=src%2Fjalview%2Fbin%2FCache.java;h=677e9adc139b7987af3991f38464221ec8dedf25;hb=2a48bda703792ad6f45e4ab60bf7ef44a1fd781f;hp=dc289028cbad0091dcafa29e3989a1ba17580e2c;hpb=55ac1885b2b6fda77037cd8b4b1daad52a60b4b2;p=jalview.git diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index dc28902..677e9ad 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -1226,9 +1226,11 @@ public class Cache setProxyProperties(startupProxyProperties[0], startupProxyProperties[1], startupProxyProperties[2], startupProxyProperties[3], startupProxyProperties[4], - startupProxyProperties[5].toCharArray(), + startupProxyProperties[5] == null ? null + : startupProxyProperties[5].toCharArray(), startupProxyProperties[6], - startupProxyProperties[7].toCharArray(), + startupProxyProperties[7] == null ? null + : startupProxyProperties[7].toCharArray(), startupProxyProperties[8]); StringBuilder sb = new StringBuilder(); sb.append("Setting proxy properties to: http.proxyHost=") @@ -1342,11 +1344,11 @@ public class Cache { try { + char[] displayHttpPw = new char[httpPassword == null ? 0 + : httpPassword.length]; + Arrays.fill(displayHttpPw, '*'); Cache.debug("CACHE Proxy: setting new Authenticator with httpUser='" - + httpUser + "' httpPassword='" - + (proxyAuthPassword == null ? "null" - : new String(proxyAuthPassword)) - + "'"); // DELETE THIS LINE (password in logs) + + httpUser + "' httpPassword='" + displayHttpPw + "'"); Authenticator.setDefault(new Authenticator() { @Override @@ -1374,7 +1376,7 @@ public class Cache .getString("label.proxy_password_required"); Preferences.openPreferences(Preferences.CONNECTIONS_TAB, message); - Preferences.getPreferences().proxyAuthPasswordFocus(); + Preferences.getInstance().proxyAuthPasswordHighlight(true); } else { @@ -1385,8 +1387,6 @@ public class Cache && getRequestingPort() == Integer .valueOf(httpPort)) { - char[] displayHttpPw = new char[httpPassword.length]; - Arrays.fill(displayHttpPw, '*'); Cache.debug( "AUTHENTICATOR returning PasswordAuthentication(\"" + httpUser + "\", '" @@ -1437,6 +1437,9 @@ public class Cache { // reset the Authenticator to protect http.proxyUser and // http.proxyPassword Just In Case + /* as noted above, due to bug in java this doesn't work if the sun.net.www.protocol.http.AuthCache + * has working credentials. No workaround for Java 11. + */ Cache.debug("AUTHENTICATOR setting default Authenticator to null"); Authenticator.setDefault(null); }