camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Http endpoint - SSL and HTTP Proxy
Date Tue, 16 Oct 2007 16:56:10 GMT
On 16/10/2007, Roman Kalukiewicz <roman.kalukiewicz@gmail.com> wrote:
> Hello,
>
> I'm new to camel, so maybe my question is obvious. Anyway I was trying
> to find an answer in google / camel web page / sources and I've
> failed.
>
> My question is about HTTP endpoint and support for SSL and HTTP Proxy.
> Is there any way to configure them?
> As far as I can see HTTP endpoint uses HTTP Client that supports those
> things, but I cannot find where to configure them. Plain HTTPS
> probably works just fine but what when I have to set my custom key
> store or client side certificate?

Good catch! :)

We'd not provided an easy way to configure those things. I've just
patched the code to make things a bit easier.

You can now grab the HttpEndpoint and configure its HttpClientParams
property which is used to create the HttpClient in the producers and
consumers.

e.g.

HttpEndpoint endpoint = context.getEndpoint("http://foo.com/bar",
HttpEndpoint.class);
endpoint.getClientParams().setAuthenticationPreemptive(true);

etc

You can also provide a strategy for completely configuring the
HttpClient - as the configuration of a HttpClient can get kinda
complex; with some stuff on the HttpClient, some on the
HttpClientParams, some on the HttpState...

endpoint.setHttpClientConfigurer(new HttpClientConfigurer() {
  public void configureHttpClient(HttpClient httpClient) {
    // customize proxy / authentication stuff here
  }
});

You can set this HttpClientConfigurer on the HttpComponent as well.

-- 
James
-------
http://macstrac.blogspot.com/

Open Source SOA
http://open.iona.com

Mime
View raw message