You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2013/10/04 22:45:22 UTC

svn commit: r1529291 - /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultCredentialsProvider.java

Author: olegk
Date: Fri Oct  4 20:45:22 2013
New Revision: 1529291

URL: http://svn.apache.org/r1529291
Log:
HTTPCLIENT-1412: SystemDefaultCredentialsProvider doesn't specify RequestorType.PROXY for proxy authentication requests

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultCredentialsProvider.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultCredentialsProvider.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultCredentialsProvider.java?rev=1529291&r1=1529290&r2=1529291&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultCredentialsProvider.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultCredentialsProvider.java Fri Oct  4 20:45:22 2013
@@ -82,6 +82,20 @@ public class SystemDefaultCredentialsPro
         internal.setCredentials(authscope, credentials);
     }
 
+    private static PasswordAuthentication getSystemCreds(
+            final AuthScope authscope,
+            final Authenticator.RequestorType requestorType) {
+        return Authenticator.requestPasswordAuthentication(
+                authscope.getHost(),
+                null,
+                authscope.getPort(),
+                "http",
+                null,
+                translateScheme(authscope.getScheme()),
+                null,
+                requestorType);
+    }
+
     public Credentials getCredentials(final AuthScope authscope) {
         Args.notNull(authscope, "Auth scope");
         final Credentials localcreds = internal.getCredentials(authscope);
@@ -89,13 +103,7 @@ public class SystemDefaultCredentialsPro
             return localcreds;
         }
         if (authscope.getHost() != null) {
-            final PasswordAuthentication systemcreds = Authenticator.requestPasswordAuthentication(
-                    authscope.getHost(),
-                    null,
-                    authscope.getPort(),
-                    "http",
-                    null,
-                    translateScheme(authscope.getScheme()));
+            final PasswordAuthentication systemcreds = getSystemCreds(authscope, null);
             if (systemcreds != null) {
                 return new UsernamePasswordCredentials(
                         systemcreds.getUserName(), new String(systemcreds.getPassword()));