On Mon, 2012-04-30 at 19:00 +0200, Olivier Rossel wrote:
> Hi everyone.
>
> I wish I could use HttpClient 4.1 through a NTLM proxy, in a Webstart
> environment.
> May be you can help me clarify a few things about that.
>
> I read that HttpClient 4.1 has out-of-the-box support of NTLM (but I
> am not sure what it really means).
>
> The doc gives such a NTLM-related code:
>
> DefaultHttpClient httpclient = new DefaultHttpClient();
> NTCredentials creds = new NTCredentials("user", "pwd",
> "myworkstation", "microsoft.com");
> httpclient.getCredentialsProvider().setCredentials(AuthScope.ANY, creds);
>
> It is very painful to ask the user its name, its pass and
> (especially!) its domain.
> That's why the JVM already does that job (in Webstart mode) : it pops
> up a JAuthenticator that asks
> the proxy user/proxy pass, it figures out the domain by itself and it
> preconfigures java.net.URL accordingly.
> Then you can use java.net.URL and URLConnection transparently, without
> any NTLM-specific code.
>
The whole process works transparently on Windows platforms simply
because java.net.HttpURLConnection makes use of platform specific native
API calls.
> So my question is:
> does HttpClient 4.1, in a Webstart envrionnement, benefit from the
> java.net.URL preconfiguration
> I mentionned ?
No, it does not.
> Or is the NTLM-related code necessary even in Webstart environments to
> let HttpClient 4.1 go through NTLM proxy? [1]
>
> [1]: in that case, how to figure out the NT domain? Asking the user
> for that information is usually very painful (:
> users do not know their NT domain)
>
As long as you are fine with your application running on Windows family
of OSes only you could consider using Windows native APIs to obtain NTLM
contextual details.
Oleg
> Any help is welcome.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]