hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject httpcomponents-client git commit: HTTPCLIENT-1888: Regression in SystemDefaultCredentialsProvider#getCredentials causing NPE
Date Tue, 05 Dec 2017 09:37:36 GMT
Repository: httpcomponents-client
Updated Branches:
  refs/heads/4.6.x 7b7cdd1fd -> 87e26b7b2


HTTPCLIENT-1888: Regression in SystemDefaultCredentialsProvider#getCredentials causing NPE


Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/commit/87e26b7b
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/tree/87e26b7b
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/diff/87e26b7b

Branch: refs/heads/4.6.x
Commit: 87e26b7b267b0724d6e4df5627f0e95893a5eae0
Parents: 7b7cdd1
Author: Oleg Kalnichevski <olegk@apache.org>
Authored: Tue Dec 5 09:57:34 2017 +0100
Committer: Oleg Kalnichevski <olegk@apache.org>
Committed: Tue Dec 5 09:58:41 2017 +0100

----------------------------------------------------------------------
 .../org/apache/http/impl/client/AuthenticationStrategyImpl.java   | 3 +--
 .../apache/http/impl/client/SystemDefaultCredentialsProvider.java | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/87e26b7b/httpclient/src/main/java/org/apache/http/impl/client/AuthenticationStrategyImpl.java
----------------------------------------------------------------------
diff --git a/httpclient/src/main/java/org/apache/http/impl/client/AuthenticationStrategyImpl.java
b/httpclient/src/main/java/org/apache/http/impl/client/AuthenticationStrategyImpl.java
index 4ca17c3..7c059d2 100644
--- a/httpclient/src/main/java/org/apache/http/impl/client/AuthenticationStrategyImpl.java
+++ b/httpclient/src/main/java/org/apache/http/impl/client/AuthenticationStrategyImpl.java
@@ -190,8 +190,7 @@ abstract class AuthenticationStrategyImpl implements AuthenticationStrategy
{
                 authScheme.processChallenge(challenge);
 
                 final AuthScope authScope = new AuthScope(
-                        authhost.getHostName(),
-                        authhost.getPort(),
+                        authhost,
                         authScheme.getRealm(),
                         authScheme.getSchemeName());
 

http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/87e26b7b/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultCredentialsProvider.java
----------------------------------------------------------------------
diff --git a/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultCredentialsProvider.java
b/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultCredentialsProvider.java
index f977d05..122a859 100644
--- a/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultCredentialsProvider.java
+++ b/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultCredentialsProvider.java
@@ -111,7 +111,7 @@ public class SystemDefaultCredentialsProvider implements CredentialsProvider
{
         final String host = authscope.getHost();
         if (host != null) {
             final HttpHost origin = authscope.getOrigin();
-            final String protocol = origin != null ? origin.getSchemeName() : (origin.getPort()
== 443 ? "https" : "http");
+            final String protocol = origin != null ? origin.getSchemeName() : (authscope.getPort()
== 443 ? "https" : "http");
             PasswordAuthentication systemcreds = getSystemCreds(protocol, authscope, Authenticator.RequestorType.SERVER);
             if (systemcreds == null) {
                 systemcreds = getSystemCreds(protocol, authscope, Authenticator.RequestorType.PROXY);


Mime
View raw message