Hello
I have to connect to a proxy in order to reach a website. So I wrote :
try {
HttpClient client = new HttpClient();
HostConfiguration hostConfig=new HostConfiguration();
hostConfig.setProxy("192.168.10.225",8888);
client.setHostConfiguration(hostConfig);
NTCredentials ntc=new
NTCredentials("user","pass","pc-cantaloup","tls");
client.getState().setProxyCredentials(AuthScope.ANY,ntc);
GetMethod method = new GetMethod(url);
method.setFollowRedirects(true);
// Execute the GET method
int statusCode = client.executeMethod(method);
if (statusCode != -1) {
String contents = method.getResponseBodyAsString();
method.releaseConnection();
System.out.println(contents);
}
} catch (Exception e) {
e.printStackTrace();
}
In traces, I readed : "INFO: ntlm authentication scheme selected" so I
supposed the library choose the authentication type by itself. But then I
have this error :
30 mai 2005 14:02:04 org.apache.commons.httpclient.HttpMethodDirector
processProxyAuthChallenge
INFO: Failure authenticating with NTLM <any realm>@192.168.10.225:8888
I thought it was perhaps a problem of encryption so I added :
try {
String secProviderName = "com.sun.crypto.provider.SunJCE";
java.security.Provider secProvider =
(java.security.Provider)Class.forName(secProviderName).newInstance();
Security.addProvider(secProvider);
}catch(Exception e) {
e.printStackTrace();
}
But nothing changed. The man who manages proxy said he didn't see my request
for authentication.
So what could I try ?
Thanks in advance for your help !
Pauline Cantaloup
--
123 Multim�dia
Service mobilit�
05.61.43.16.68
D�charge / Disclaimer
Ce message et toutes les pi�ces jointes (ci-apr�s le "message") sont
confidentiels et �tablis � l'intention exclusive des destinataires. Toute
utilisation ou diffusion non autoris�e est interdite. Tout message �lectronique
�tant susceptible d'alt�ration, 123Multim�dia et ses filiales d�clinent toute
responsabilit� au titre de ce message s'il a �t� alt�r�, d�form� ou falsifi�.
This message and any attachments (the "message") are confidential and intended
solely for the addressees. Any unauthorised use or dissemination is prohibited.
E-mails are susceptible to alteration. Therefore neither 123Multim�dia nor any
of its subsidiaries or affiliates shall be liable for the message if altered,
changed or falsified.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]