hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Crosbie <kcros...@ravenpack.com>
Subject Repeated Proxy-Authorization Challenges
Date Fri, 09 Nov 2007 17:24:25 GMT

I've written an app that makes Post requests using an instance of
My app sometimes talks through a Proxy server using the Digest scheme
and for the most part, succeeds.
The app is not so far off the example in:

At the beginning, I set the proxy credentials:

        if (proxyauth != null) {
            new AuthScope(proxyHost, proxyPort),
            new UsernamePasswordCredentials(proxyauth));

and this allows my app to authenticate with the Proxy server.

My problem came when I watched the packets being sent using Wireshark.
I expected that for new posts after the initial authentication, the
Proxy-Authorization header would always be sent.
Instead, each new post method must re-authenticate, which is completely

My questions are:
* Does HttpClient support resending of authorization information?
* If it does (I assume it does), how does one make this happen?
* If the default behaviour is to resend, what could I be doing that
causes it to not happen.
  Things that come to mind are:
     - calling PostMethod.setDoAuthentication(true);
     - finishing each post with PostMethod.releaseConnection();
     - Using a new instance of a PostMethod every time (I assumed the
auth info would be a property of the HttpClient);

I'd appreciate any pointers.

Best Regards,

Kevin Crosbie

To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org

View raw message