hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1784149 - /httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/HttpAsyncClientBuilder.java
Date Thu, 23 Feb 2017 15:12:08 GMT
Author: olegk
Date: Thu Feb 23 15:12:08 2017
New Revision: 1784149

URL: http://svn.apache.org/viewvc?rev=1784149&view=rev
Log:
HTTPASYNC-118: HttpAsyncClientBuilder to use SystemDefaultCredentialsProvider by default when
configured to use system properties

Modified:
    httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/HttpAsyncClientBuilder.java

Modified: httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/HttpAsyncClientBuilder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/HttpAsyncClientBuilder.java?rev=1784149&r1=1784148&r2=1784149&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/HttpAsyncClientBuilder.java
(original)
+++ httpcomponents/httpasyncclient/branches/4.1.x/httpasyncclient/src/main/java/org/apache/http/impl/nio/client/HttpAsyncClientBuilder.java
Thu Feb 23 15:12:08 2017
@@ -80,6 +80,7 @@ import org.apache.http.impl.client.Defau
 import org.apache.http.impl.client.DefaultRedirectStrategy;
 import org.apache.http.impl.client.NoopUserTokenHandler;
 import org.apache.http.impl.client.ProxyAuthenticationStrategy;
+import org.apache.http.impl.client.SystemDefaultCredentialsProvider;
 import org.apache.http.impl.client.TargetAuthenticationStrategy;
 import org.apache.http.impl.conn.DefaultProxyRoutePlanner;
 import org.apache.http.impl.conn.DefaultRoutePlanner;
@@ -831,9 +832,12 @@ public class HttpAsyncClientBuilder {
 
         CredentialsProvider defaultCredentialsProvider = this.credentialsProvider;
         if (defaultCredentialsProvider == null) {
-            defaultCredentialsProvider = new BasicCredentialsProvider();
+            if (systemProperties) {
+                defaultCredentialsProvider = new SystemDefaultCredentialsProvider();
+            } else {
+                defaultCredentialsProvider = new BasicCredentialsProvider();
+            }
         }
-
         RedirectStrategy redirectStrategy = this.redirectStrategy;
         if (redirectStrategy == null) {
             redirectStrategy = DefaultRedirectStrategy.INSTANCE;



Mime
View raw message