ffang opened a new pull request, #3255:
URL: https://github.com/apache/cxf/pull/3255

   …n proxy auth failure
   
   When the HC5 async conduit receives a 407 Proxy Authentication Required 
response with wrong credentials and MaxRetransmits>0 or AutoRedirect=true (as 
in the JIRA), the request entity is marked repeatable so HC5 retries after the 
first 407. A concurrent write-failure on the Connection: close socket races 
with the retry's execute() call, causing 
InternalHttpAsyncExecRuntime.ensureValid() to find a null endpointRef and throw 
IllegalStateException. Without MaxRetransmits/AutoRedirect the entity is not 
repeatable and HC5 intercepts the 407 internally, calling 
asyncExecCallback.completed() without signaling CXF's future and leaving 
getHttpResponse() blocked indefinitely on wait().
   
   Fix:
   - Promote HttpClientContext ctx to a field on AsyncWrappedOutputStream so it 
is accessible after HC5 calls back.
   - Replace wait() with wait(receiveTimeout) to bound the wait.
   - In both the timeout path and the RuntimeException (ISE) path, check 
ctx.getResponse() for a 407 status and throw HTTPException(407) instead of 
re-throwing the raw exception or blocking forever.
   
   Test:
   - ProxyAuthIllegalStateTest: reproduces the ISE via a raw ServerSocket proxy 
returning 407+Connection:close, with MaxRetransmits=5 and AutoRedirect=true 
matching the exact JIRA configuration.


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to