You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ychawla <pr...@yahoo.com> on 2009/12/14 20:30:23 UTC

Re: HTTPS authentication setup using camel-http

Is it possible to do this same 'hookup' using the Spring DSL.  I am not sure
if it is possible to specify this in Spring:

HttpComponent httpComponent = (HttpComponent)
getContext().getComponent("http");
httpComponent.setHttpClientConfigurer(new MyHttpClientConfigurer()); 


bwhite wrote:
> 
> Thanks for the info Willem, that's just what I needed.
> 
> Here's a little more information for anyone who may end up following in my
> footsteps:
> 
> Create a class that implements HttpClientConfigurer, and registers https
> protocol providing a keystore or truststore per Willem's example below.
> Then, from your camel route builder class you can hook it up like so:
> 
> HttpComponent httpComponent = (HttpComponent)
> getContext().getComponent("http");
> httpComponent.setHttpClientConfigurer(new MyHttpClientConfigurer());
> 
> Bryan
> 
> 
> willem.jiang wrote:
>> 
>> 
>> If you just wan to specify the keystore and truststore you can do int in 
>> your HttpClientConfigurer.
>> 
>> Protocol authhttps = new Protocol("https",
>> new AuthSSLProtocolSocketFactory(
>> new URL("file:my.keystore"), "mypassword",
>> new URL("file:my.truststore"), "mypassword"), 443);
>> Protocol.registerProtocol("https", authhttps);
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Re%3A-HTTPS-authentication-setup-using-camel-http-tp26190394p26779969.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: HTTPS authentication setup using camel-http

Posted by ychawla <pr...@yahoo.com>.
Hi Gang,
I added an update to the WIKI with some more info on doing this with Spring:
http://cwiki.apache.org/confluence/display/CAMEL/HTTP

I hope this is okay.  Here are the details:

If you are doing this using the Spring DSL, you can specify your
HttpClientConfigurer using the URI. For example:

<bean id="myHttpClientConfigurer"
 class="my.https.HttpClientConfigurer">
</bean>

<to
uri="https://myhostname.com:443/myURL?httpClientConfigurerRef=myHttpClientConfigurer"/> 

As long as you implement the HttpClientConfigurer and configure your
keystore and truststore as described above, it will work fine.



ychawla wrote:
> 
> Is it possible to do this same 'hookup' using the Spring DSL.  I am not
> sure if it is possible to specify this in Spring:
> 
> HttpComponent httpComponent = (HttpComponent)
> getContext().getComponent("http");
> httpComponent.setHttpClientConfigurer(new MyHttpClientConfigurer()); 
> 
-- 
View this message in context: http://old.nabble.com/Re%3A-HTTPS-authentication-setup-using-camel-http-tp26190394p26780221.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: HTTPS authentication setup using camel-http

Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, Dec 14, 2009 at 8:30 PM, ychawla <pr...@yahoo.com> wrote:
>
> Is it possible to do this same 'hookup' using the Spring DSL.  I am not sure
> if it is possible to specify this in Spring:
>
> HttpComponent httpComponent = (HttpComponent)
> getContext().getComponent("http");
> httpComponent.setHttpClientConfigurer(new MyHttpClientConfigurer());
>

Yeah see the  - Setting MaxConnectionsPerHost - example from this page
http://camel.apache.org/http


>
> bwhite wrote:
>>
>> Thanks for the info Willem, that's just what I needed.
>>
>> Here's a little more information for anyone who may end up following in my
>> footsteps:
>>
>> Create a class that implements HttpClientConfigurer, and registers https
>> protocol providing a keystore or truststore per Willem's example below.
>> Then, from your camel route builder class you can hook it up like so:
>>
>> HttpComponent httpComponent = (HttpComponent)
>> getContext().getComponent("http");
>> httpComponent.setHttpClientConfigurer(new MyHttpClientConfigurer());
>>
>> Bryan
>>
>>
>> willem.jiang wrote:
>>>
>>>
>>> If you just wan to specify the keystore and truststore you can do int in
>>> your HttpClientConfigurer.
>>>
>>> Protocol authhttps = new Protocol("https",
>>> new AuthSSLProtocolSocketFactory(
>>> new URL("file:my.keystore"), "mypassword",
>>> new URL("file:my.truststore"), "mypassword"), 443);
>>> Protocol.registerProtocol("https", authhttps);
>>>
>>>
>>
>>
>
> --
> View this message in context: http://old.nabble.com/Re%3A-HTTPS-authentication-setup-using-camel-http-tp26190394p26779969.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus