< prev index next >

src/java.base/unix/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java

Print this page
rev 14210 : 8154231: Simplify access to System properties from JDK code
Reviewed-by: rriggs

*** 37,46 **** --- 37,47 ---- import sun.net.www.HeaderParser; import sun.net.www.protocol.http.AuthenticationInfo; import sun.net.www.protocol.http.AuthScheme; import sun.net.www.protocol.http.HttpURLConnection; + import sun.security.action.GetPropertyAction; /** * NTLMAuthentication: * * @author Michael McMahon
*** 71,86 **** private static final NTLMAuthenticationCallback NTLMAuthCallback = NTLMAuthenticationCallback.getNTLMAuthenticationCallback(); private String hostname; ! private static String defaultDomain; /* Domain to use if not specified by user */ ! ! static { ! defaultDomain = java.security.AccessController.doPrivileged( ! new sun.security.action.GetPropertyAction("http.auth.ntlm.domain", "")); ! }; public static boolean supportsTransparentAuth () { return false; } --- 72,84 ---- private static final NTLMAuthenticationCallback NTLMAuthCallback = NTLMAuthenticationCallback.getNTLMAuthenticationCallback(); private String hostname; ! /* Domain to use if not specified by user */ ! private static String defaultDomain = ! GetPropertyAction.getProperty("http.auth.ntlm.domain", ""); public static boolean supportsTransparentAuth () { return false; }
*** 141,152 **** username = s.substring (i+1); } password = pw.getPassword(); init0(); try { ! String version = java.security.AccessController.doPrivileged( ! new sun.security.action.GetPropertyAction("ntlm.version")); client = new Client(version, hostname, username, ntdomain, password); } catch (NTLMException ne) { try { client = new Client(null, hostname, username, ntdomain, password); } catch (NTLMException ne2) { --- 139,149 ---- username = s.substring (i+1); } password = pw.getPassword(); init0(); try { ! String version = GetPropertyAction.getProperty("ntlm.version"); client = new Client(version, hostname, username, ntdomain, password); } catch (NTLMException ne) { try { client = new Client(null, hostname, username, ntdomain, password); } catch (NTLMException ne2) {
< prev index next >