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:51 GMT
Repository: httpcomponents-client
Updated Branches:
  refs/heads/4.5.x ea73f439e -> 5bed67087


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/5bed6708
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/tree/5bed6708
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/diff/5bed6708

Branch: refs/heads/4.5.x
Commit: 5bed670873a2e197bc047737d2f0f4518ab94524
Parents: ea73f43
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:27 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/5bed6708/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/5bed6708/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