You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Sébastien Nussbaumer <se...@gmail.com> on 2008/11/19 11:17:16 UTC
Looks like the request gets sent three times when going through a proxy requiring NTLM authentication. Am I wrong ?
Hi all !
I've been using HttpClient 3.1 for quite a while now to do multipart file
uploads to an http server.
I've added a quick hack to FilePart.sendData in order to know how many bytes
are being written to the outputStream and have an idea of the progress of
the upload. This has been working fine for a while now.
But lately I've been also making sure that everything worked fine when
uploading through a proxy that requires NTLM authentication, and I noticed
that the content is read and sent to the outputStream three times, probably
once for the each authentication stage and once for the actuel upload to the
server.
This doesn't happen over HTTPS connections, only HTTP connections (I tested
that I'm going through the proxy for both types of connections)
Is this normal ?
Is there a way to prevent this ?
Thanks !
Sebastien Nussbaumer
Re: Looks like the request gets sent three times when going through a proxy requiring NTLM authentication. Am I wrong ?
Posted by Sébastien Nussbaumer <se...@gmail.com>.
>
> This doesn't happen over HTTPS connections, only HTTP connections (I tested
>> that I'm going through the proxy for both types of connections)
>>
>
> I doubt that the connection type should make any difference here.
I'll check again, I thought maybe the real data was been sent only once the
SSL tunnel was established (and in that cas would be completely oblivious to
the fact that there is a proxy, juste guessing though)
>
> Is this normal ?
>>
>
> NTLM authentication usually requires 3 request/response round-trips to
> complete, so it is normal.
>
>
> Is there a way to prevent this ?
>>
>
> Do a GET or a HEAD before doing POST to make sure the connection is
> authenticated before sending a large body of content.
OK I'll give it a try, I wanted to avoid this kind of hack but it everything
makes sense.
>
> Hope this helps
Sure Thanks !!
Sebastien
Re: Looks like the request gets sent three times when going through
a proxy requiring NTLM authentication. Am I wrong ?
Posted by Oleg Kalnichevski <ol...@apache.org>.
Sébastien Nussbaumer wrote:
> Hi all !
> I've been using HttpClient 3.1 for quite a while now to do multipart file
> uploads to an http server.
> I've added a quick hack to FilePart.sendData in order to know how many bytes
> are being written to the outputStream and have an idea of the progress of
> the upload. This has been working fine for a while now.
> But lately I've been also making sure that everything worked fine when
> uploading through a proxy that requires NTLM authentication, and I noticed
> that the content is read and sent to the outputStream three times, probably
> once for the each authentication stage and once for the actuel upload to the
> server.
> This doesn't happen over HTTPS connections, only HTTP connections (I tested
> that I'm going through the proxy for both types of connections)
I doubt that the connection type should make any difference here.
> Is this normal ?
NTLM authentication usually requires 3 request/response round-trips to
complete, so it is normal.
> Is there a way to prevent this ?
Do a GET or a HEAD before doing POST to make sure the connection is
authenticated before sending a large body of content.
Hope this helps
Oleg
> Thanks !
>
> Sebastien Nussbaumer
>
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org