jira-importer opened a new issue, #1424: URL: https://github.com/apache/httpcomponents-core/issues/1424
**[Reinhold Früsmer](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=fruesmerre)** opened **[HTTPCORE-434](https://issues.apache.org/jira/browse/HTTPCORE-434?redirect=false)** and commented Hi, I'm not sure if this is a problem with HttpClient itself or with Squid (3.3.8) proxy server, but maybe you could please advise. Our client application first sends a HEAD request for NTLM authentication with the proxy and then re-uses the execution context as described in https://hc.apache.org/httpcomponents-client-ga/tutorial/html/authentication.html for the following POST requests. Using more recent versions of Tomcat on the server-side, re-using the execution context does not work anymore, the NTLM authentication negotiate-challenge is repeated forever and following POST requests with chunked transfer-encoding don't work since they are interrupted by the authentication challenge. I figured out the difference betweeen newer and older Tomcat versions and found the reason: previously, Tomcat automatically added a "Content-Length: 0" header to the reponse of HEAD requests. With "Bug 59310 - Content-Length of HEAD requests incorrectly computed as 0" (https://bz.apache.org/bugzilla/show_bug.cgi?id=59310), this behavior was changed and without this header, NTLM connections to the proxy don't persist anymore. As the content-length header is optional in a response to a HEAD request (RFC 7230), the problem must be either in HttpClient or Squid proxy. Thanks in advance! Best regards Reinhold --- **Affects:** 4.4.5 **Attachments:** - [tomcat-squid-ntlm-not-stateful.pcapng](https://issues.apache.org/jira/secure/attachment/12831505/tomcat-squid-ntlm-not-stateful.pcapng) (_13.31 kB_) - [tomcat-squid-ntlm-stateful.pcapng](https://issues.apache.org/jira/secure/attachment/12831504/tomcat-squid-ntlm-stateful.pcapng) (_8.88 kB_) - [wire-context-log.txt](https://issues.apache.org/jira/secure/attachment/12831532/wire-context-log.txt) (_90.54 kB_) - [wirelog-4.5.3.txt](https://issues.apache.org/jira/secure/attachment/12831758/wirelog-4.5.3.txt) (_92.01 kB_) **Backported to:** [4.4.6](https://github.com/apache/httpcomponents-core/milestone/43?closed=1) -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
