1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-14 03:32:22 -05:00

Experimental: reactivate NTLM authentication but leave authentication preemptive mode to allow basic authentication.

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@851 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-11-23 23:17:08 +00:00
parent c4e19e4d3f
commit 7f2fc8fc36

View File

@ -25,7 +25,6 @@ import davmail.exception.HttpForbiddenException;
import davmail.exception.HttpNotFoundException;
import davmail.ui.tray.DavGatewayTray;
import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.auth.AuthPolicy;
import org.apache.commons.httpclient.auth.AuthScope;
import org.apache.commons.httpclient.methods.DeleteMethod;
import org.apache.commons.httpclient.methods.GetMethod;
@ -40,7 +39,6 @@ import org.apache.jackrabbit.webdav.property.DavPropertyNameSet;
import org.apache.log4j.Logger;
import java.io.IOException;
import java.util.ArrayList;
import java.net.InetAddress;
import java.net.UnknownHostException;
@ -101,7 +99,7 @@ public final class DavGatewayHttpClientFacade {
hostConfig.setHost(httpURI);
// some Exchange servers redirect to a different host for freebusy, use wide auth scope
AuthScope authScope = new AuthScope(null, -1);
httpClient.getState().setCredentials(authScope, new UsernamePasswordCredentials(userName, password));
httpClient.getState().setCredentials(authScope, new NTCredentials(userName, password, "", ""));
} catch (URIException e) {
throw new DavMailException("LOG_INVALID_URL", url);
}
@ -119,12 +117,6 @@ public final class DavGatewayHttpClientFacade {
httpClient.setHttpConnectionManager(multiThreadedHttpConnectionManager);
}
ArrayList<String> authPrefs = new ArrayList<String>();
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;