commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Sutton <>
Subject RE: Re[2]: [httpclient] Get through a proxy problem
Date Tue, 29 Apr 2003 23:34:04 GMT
Hi Iker,
I can't even begin to guess what the problem is without at least a debug
log.  Please take a look at 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

Also, you probably want to take a look at the SSL code in the contrib and/or
samples directories in CVS.


Adrian Sutton, Software Engineer
Ephox Corporation 

-----Original Message-----
From: Iker Bilbao []
Sent: Wednesday, 30 April 2003 12:09 AM
To: Tauzell, Dave
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ó:

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 [] 
TD> Sent: Tuesday, April 29, 2003 2:40 AM
TD> To:
TD> Subject: [httpclient] Get through a proxy problem

TD> Hello,

TD>   IŽm totally desperated. IŽm 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;
TD>   System.getProperties().put("java.protocol.handler.pkgs",
TD>   System.setProperty("","C:\\.keystore");
TD>   System.setProperty("","C:\\.keystore");
TD>   System.setProperty("","password");

TD>   HttpClient client = new HttpClient();
TD>   client.getState().setCredentials("realm",new

TD>   GetMethod get = new getMethod("https://server:1234" +"/index.html");
TD>   get.setDoAuthentication( true );

TD>   try
TD>   {
TD>      int status = 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>   }
TD>   -------------------

TD> So I added the following lines:

TD>    HttpClient client = new HttpClient();
TD>    HostConfiguration hc = new HostConfiguration();
TD>    client.setHostConfiguration(hc);
TD>    client.getState().setCredentials("realm",new

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:

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:
TD> For additional commands, e-mail:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message