Return-Path: Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 27445 invoked from network); 29 Apr 2003 23:34:05 -0000 Received: from unknown (HELO bigcow.intraephox.ephox.com) (202.138.204.102) by daedalus.apache.org with SMTP; 29 Apr 2003 23:34:04 -0000 Received: by bigcow.intraephox.ephox.com with Internet Mail Service (5.5.2653.19) id ; Wed, 30 Apr 2003 09:34:05 +1000 Message-ID: <8D585857D762F741A47C1E1597FEAD3003B5DE@bigcow.intraephox.ephox.com> From: Adrian Sutton To: 'Jakarta Commons Users List' , 'Iker Bilbao' Subject: RE: Re[2]: [httpclient] Get through a proxy problem Date: Wed, 30 Apr 2003 09:34:04 +1000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi Iker, I can't even begin to guess what the problem is without at least a = debug log. Please take a look at http://jakarta.apache.org/commons/httpclient/troubleshooting.html and provide as much information from the steps listed there as you can, particularly the wire trace log. There is more information on logging = at http://jakarta.apache.org/commons/httpclient/logging.html Also, you probably want to take a look at the SSL code in the contrib = and/or samples directories in CVS. Regards, Adrian Sutton, Software Engineer Ephox Corporation www.ephox.com=20 -----Original Message----- From: Iker Bilbao [mailto:ibc19@tid.es] Sent: Wednesday, 30 April 2003 12:09 AM To: Tauzell, Dave Cc: commons-user@jakarta.apache.org Subject: Re[2]: [httpclient] Get through a proxy problem Hola Dave, Yes, off course. It works perfectly with the browser. It was working until I had to go through the proxy server. If I send the request to a machine in my LAN it works. But, when I try to obtain a page from outside through the proxy I always get an error. The only diference between two examples are the lines to setup the proxy. Tuesday, April 29, 2003, 3:22:47 PM, escribi=F3: TD> Have you tried submitting this request with a regular web browser = and proxies set up? Just to verify it isn't the HTTPClient? TD> -Dave TD> -----Original Message----- TD> From: Iker Bilbao [mailto:ibc19@tid.es]=20 TD> Sent: Tuesday, April 29, 2003 2:40 AM TD> To: commons-user@jakarta.apache.org TD> Subject: [httpclient] Get through a proxy problem TD> Hello, TD> I=AEm totally desperated. I=AEm trying to make a simple get over = https. TD> Everythings went well until I had to pass through a proxy to make TD> the request. This piece of code worked perfectly: TD> Here is my code: TD> ------------------- TD> Security.addProvider(new = com.sun.net.ssl.internal.ssl.Provider()); TD> System.getProperties().put("java.protocol.handler.pkgs", "org.apache.commons.httpclient.HttpClient"); TD> System.setProperty("javax.net.ssl.trustStore","C:\\.keystore"); TD> System.setProperty("javax.net.ssl.keyStore","C:\\.keystore"); TD> System.setProperty("javax.net.ssl.keyStorePassword","password"); TD> HttpClient client =3D new HttpClient(); TD> client.getState().setCredentials("realm",new TD> UsernamePasswordCredentials("user","password")); TD> GetMethod get =3D new getMethod("https://server:1234" = +"/index.html"); TD> get.setDoAuthentication( true ); TD> try TD> { TD> int status =3D client.executeMethod( get ); TD> System.out.println(status + "\n" + = get.getResponseBodyAsString()); TD> } TD> catch (HttpRecoverableException e) TD> { TD> System.err.println("A recoverable exception occurred, = retrying. " + e.getMessage()); TD> } TD> catch (IOException e) TD> { TD> System.err.println("Failed to download file."); TD> e.printStackTrace(); TD> System.exit(-1); TD> } TD> catch (Exception e) TD> { TD> e.printStackTrace(); TD> } =20 TD> ------------------- TD> So I added the following lines: TD> HttpClient client =3D new HttpClient(); TD> HostConfiguration hc =3D new HostConfiguration(); TD> hc.setProxy(properties.getProperty("hostProxy"),Integer.parseInt(propert= ies. getProperty("portProxy"))); TD> client.setHostConfiguration(hc); TD> client.getState().setCredentials("realm",new UsernamePasswordCredentials("user","password")); TD> And I got the following error: TD> HTTP/1.0 500 Server Error TD> I have tried with every nightly drop from 19th of April to 28 of = April and I always get and error. Sometimes this or sometimes another. I = think that logical the code should be like this. TD> I have tryed a workaround I have read I the example archive called: CustomHttpConnection.java TD> And I always get and error or a null response. TD> Please, can anyone give lend a hand? How can I do this? TD> Thanks in advance por your help. TD> Iker TD> = --------------------------------------------------------------------- TD> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org TD> For additional commands, e-mail: = commons-user-help@jakarta.apache.org --=20 Saludos, Iker mailto:ibc19@tid.es --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org