==== //depot/usr/ravi/nutch/src/plugin/protocol-httpclient/src/java/org/apache/nutch/protocol/httpclient/Http.java#1 (text) - //depot/usr/ravi/nutch/src/plugin/protocol-httpclient/src/java/org/apache/nutch/protocol/httpclient/Http.java#2 (text) ==== content
@@ -31,6 +31,7 @@
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
 import org.apache.commons.httpclient.NTCredentials;
+import org.apache.commons.httpclient.UsernamePasswordCredentials;
 import org.apache.commons.httpclient.auth.AuthScope;
 import org.apache.commons.httpclient.params.HttpConnectionManagerParams;
 import org.apache.commons.httpclient.protocol.Protocol;
@@ -65,6 +66,8 @@
   String ntlmPassword = "";
   String ntlmDomain = "";
   String ntlmHost = "";
+  String basicUsername = "";
+  String basicPassword = "";
 
   public Http() {
     super(LOG);
@@ -77,6 +80,8 @@
     this.ntlmPassword = conf.get("http.auth.ntlm.password", "");
     this.ntlmDomain = conf.get("http.auth.ntlm.domain", "");
     this.ntlmHost = conf.get("http.auth.ntlm.host", "");
+    basicUsername = conf.get("http.auth.basic.username");
+    basicPassword = conf.get("http.auth.basic.password");
     //Level logLevel = Level.WARNING;
     //if (conf.getBoolean("http.verbose", false)) {
     //  logLevel = Level.FINE;
@@ -131,6 +136,7 @@
     if (useProxy) {
       hostConf.setProxy(proxyHost, proxyPort);
     }
+    /*
     if (ntlmUsername.length() > 0) {
       Credentials ntCreds = new NTCredentials(ntlmUsername, ntlmPassword, ntlmHost, ntlmDomain);
       client.getState().setCredentials(new AuthScope(ntlmHost, AuthScope.ANY_PORT), ntCreds);
@@ -139,6 +145,11 @@
         LOG.info("Added NTLM credentials for " + ntlmUsername);
       }
     }
+    */
+
+    client.getParams().setAuthenticationPreemptive(true);
+    if (LOG.isInfoEnabled()) { LOG.info("**** setting basic auth credentials ****"); }
+    client.getState().setCredentials(new AuthScope("linuxlink.timesys.com", AuthScope.ANY_PORT, AuthScope.ANY_REALM), new UsernamePasswordCredentials(basicUsername, basicPassword));
     if (LOG.isInfoEnabled()) { LOG.info("Configured Client"); }
   }
 }
