Index: Authenticator.java
===================================================================
RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/Authenticator.java,v
retrieving revision 1.28
diff -u -r1.28 Authenticator.java
--- Authenticator.java	14 Sep 2002 21:47:08 -0000	1.28
+++ Authenticator.java	25 Sep 2002 04:53:00 -0000
@@ -301,6 +301,22 @@
         }
 
         if (null == cred) {
+            if (log.isInfoEnabled()) {
+                log.info("No credentials found for realm \"" + realm + "\", "
+                    + "attempting to use default credentials.");
+            }
+
+            try {
+                cred = (UsernamePasswordCredentials) (proxy
+                    ? state.getProxyCredentials(null)
+                    : state.getCredentials(null));
+            } catch (ClassCastException e) {
+                throw new HttpException("UsernamePasswordCredentials required "
+                    + "for Basic authentication.");
+            }
+        }
+
+        if (null == cred) {
             throw new HttpException("No credentials available for the Basic "
                                     + "authentication realm \'" + realm + "\'");
         } else {

