diff --git a/src/java/davmail/http/DavGatewayHttpClientFacade.java b/src/java/davmail/http/DavGatewayHttpClientFacade.java index ef5209ae..898029f0 100644 --- a/src/java/davmail/http/DavGatewayHttpClientFacade.java +++ b/src/java/davmail/http/DavGatewayHttpClientFacade.java @@ -1,7 +1,7 @@ package davmail.http; import davmail.Settings; -import davmail.tray.DavGatewayTray; +import davmail.ui.tray.DavGatewayTray; import org.apache.commons.httpclient.*; import org.apache.commons.httpclient.auth.AuthPolicy; import org.apache.commons.httpclient.auth.AuthScope; @@ -73,6 +73,12 @@ public final class DavGatewayHttpClientFacade { public static void configureClient(HttpClient httpClient) { httpClient.setHttpConnectionManager(multiThreadedHttpConnectionManager); + ArrayList authPrefs = new ArrayList(); + authPrefs.add(AuthPolicy.DIGEST); + authPrefs.add(AuthPolicy.BASIC); + // exclude the NTLM authentication scheme + httpClient.getParams().setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY, authPrefs); + boolean enableProxy = Settings.getBooleanProperty("davmail.enableProxy"); String proxyHost = null; int proxyPort = 0; @@ -91,12 +97,6 @@ public final class DavGatewayHttpClientFacade { httpClient.getHostConfiguration().setProxy(proxyHost, proxyPort); if (proxyUser != null && proxyUser.length() > 0) { - ArrayList authPrefs = new ArrayList(); - authPrefs.add(AuthPolicy.DIGEST); - authPrefs.add(AuthPolicy.BASIC); - // exclude the NTLM authentication scheme - httpClient.getParams().setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY, authPrefs); - AuthScope authScope = new AuthScope(proxyHost, proxyPort, AuthScope.ANY_REALM); // detect ntlm authentication (windows domain name in user name)