hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Borges <bruno.bor...@gmail.com>
Subject Re: Bad Request after multiple requests
Date Mon, 25 Jul 2005 23:14:02 GMT
Just to keep my response clear: 

The website sent a "Location" header with HTTP, not HTTPS URL.
HttpClient is redirecting the method correctly, but changing the
HostConfiguration instance.

On 7/25/05, Bruno Borges <bruno.borges@gmail.com> wrote:
> Ortwin, I enabled the wire log and discovered that the
> HostConfiguration object was been changed after a redirect location is
> sent back from the server. The page gives a error and HttpClient
> follow the redirection header to the website in 'http' protocol, not
> anymore 'https' as the HostConfiguration was constructed before.
> 
> I'm changing the code to 'setFollowRedirects(false)' but I'm not sure
> if this should be the best way to fix this problem. Shouldn't the
> HostConfiguration object never be changed by the HttpClient instance ?
> The GetMethod was redirected, but HC should stay the same.
> 
> Thank you
> 
> On 7/25/05, Ortwin Glück <odi@odi.ch> wrote:
> > Bruno,
> >
> > please post the wirelog or I am unable to help you. Thanks.
> >
> > Ortwin
> >
> >
> > Bruno Borges wrote:
> > > Well Glück, about HTTP/1.1, thanks.
> > > But now let's go futher with 400 "Bad Request".
> > >
> > > I'm behind a proxy, and after more or less 90 requests, the proxy give
> > > me this error. The message in the body is this one:
> > >
> > >     The request was rejected because the port it was connecting to
> > >     is not configured to receive the protocol being sent.
> > >      Please contact your network administrator.
> > >
> > > My proxied HttpClient is configured this way (encapsulated):
> > >
> > >   private AuthScope proxyAS = new AuthScope("myproxyhost.com", 443);
> > >   private Credentials proxyAuth = new
> > > UsernamePasswordCredentials("user", "pass");
> > >   private ProxyHost proxyHost = new ProxyHost("myproxyhost", 443);
> > >
> > >   executeMethod(HostConfiguration hostconfig, HttpMethod method,
> > >                       HttpState state) ... {
> > >       state.setProxyCredentials(proxyAS, proxyAuth);
> > >       hostconfig.setProxyHost(proxyHost);
> > >
> > >       this.httpClient.executeMethod(state, method, hostconfig);
> > >   }
> > >
> > > Is there something wrong doing this way?
> > >
> > > Thank you,
> > > Bruno
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org
> >
> >
> 
> 
> --
> Bruno Borges - SCJP 1.4
> bruno.borges@gmail.com
> 


-- 
Bruno Borges - SCJP 1.4
bruno.borges@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org


Mime
View raw message