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 e6263615f..3d1ff9593 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 @@ -245,17 +245,13 @@ class AuthenticationStrategyImpl implements AuthenticationStrategy { if (authhost == null) { throw new IllegalArgumentException("Host may not be null"); } - if (authScheme == null) { - throw new IllegalArgumentException("Auth scheme may not be null"); - } if (context == null) { throw new IllegalArgumentException("HTTP context may not be null"); } AuthCache authCache = (AuthCache) context.getAttribute(ClientContext.AUTH_CACHE); if (authCache != null) { if (this.log.isDebugEnabled()) { - this.log.debug("Removing from cache '" + authScheme.getSchemeName() + - "' auth scheme for " + authhost); + this.log.debug("Clearing cached auth scheme for " + authhost); } authCache.remove(authhost); } diff --git a/httpclient/src/main/java/org/apache/http/impl/client/HttpAuthenticator.java b/httpclient/src/main/java/org/apache/http/impl/client/HttpAuthenticator.java index db22b64d0..034de0066 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/HttpAuthenticator.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/HttpAuthenticator.java @@ -108,7 +108,7 @@ public class HttpAuthenticator { case HANDSHAKE: if (authScheme == null) { this.log.debug("Auth scheme is null"); - authStrategy.authFailed(host, authState.getAuthScheme(), context); + authStrategy.authFailed(host, null, context); authState.reset(); authState.setState(AuthProtocolState.FAILURE); return false;