You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by GitBox <gi...@apache.org> on 2020/04/26 01:03:18 UTC

[GitHub] [httpcomponents-client] vonahok opened a new pull request #223: HTTPCLIENT-2077: Migration from HttpClient v4.5.x to v5.0 causes NTLM…

vonahok opened a new pull request #223:
URL: https://github.com/apache/httpcomponents-client/pull/223


   … proxy authentication failure.
   
   The failure was caused by unnecessary null check `authChallenge.getValue()` throwing a MalformedChallengeException in the method `org.apache.hc.client5.http.impl.auth.NTLMScheme# processChallenge` :
   
   ```
       @Override
       public void processChallenge(
               final AuthChallenge authChallenge,
               final HttpContext context) throws MalformedChallengeException {
           Args.notNull(authChallenge, "AuthChallenge");
           if (authChallenge.getValue() == null) {    <----------------- NOT NECESSARY CHECK 
               throw new MalformedChallengeException("Missing auth challenge");
           }
           this.challenge = authChallenge.getValue();
           if (this.challenge == null || this.challenge.isEmpty()) {  <--- CORRECT CONDITION CHECK
               if (this.state == State.UNINITIATED) {
                   this.state = State.CHALLENGE_RECEIVED;
               } else {
                   this.state = State.FAILED;
               }
           } else {
               if (this.state.compareTo(State.MSG_TYPE1_GENERATED) < 0) {
                   this.state = State.FAILED;
                   throw new MalformedChallengeException("Out of sequence NTLM response message");
               } else if (this.state == State.MSG_TYPE1_GENERATED) {
                   this.state = State.MSG_TYPE2_RECEVIED;
               }
           }
       }
   
   ```
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org