Pauline, Please post the complete wire/context log of the HTTP session.
http://jakarta.apache.org/commons/httpclient/3.0/logging.html Oleg On Mon, May 30, 2005 at 02:24:48PM +0200, Pauline CANTALOUP wrote: > 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, > > 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 subsidiari > > > --------------------------------------------------------------------- > 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]
