camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From milanmilas <milanmi...@gmail.com>
Subject Re: Camel route - ActiveMQ from http to Https
Date Fri, 22 Feb 2013 17:01:26 GMT
Final solution:
GenerateCertificate
(must use localhost or server name, depending how you define URL in Caml,
names must match)

keytool -genkey -alias localhost -keyalg RSA -keystore server.ks
keytool -export -alias localhost -keystore server.ks -file server_cert
keytool -import -alias -keystore localhost client.ts -file server_cert

activemq.xml
<transportConnector name="https" uri="https://localhost:8443?trace=true"/

<sslContext>
<sslContext keyStore="file:${data}/conf/server1.ks" 
keyStorePassword="seaward" 
trustStore="file:${data}/conf/mybroker.ts"
trustStorePassword="seaward"/>
</sslContext>

Camel:
public class SetSystemProperties {


private static final transient Logger LOG =
LoggerFactory.getLogger(SetSystemProperties.class);

public SetSystemProperties(){
LOG.info("processing SetSystemProperties");
System.setProperty("javax.net.ssl.trustStore","M:/Projects/conf/server.ts");
System.setProperty("javax.net.ssl.trustStorePassword","password");
System.setProperty("javax.net.ssl.keyStore","M:/Projects/conf/conshrnhsp.ks");
System.setProperty("javax.net.ssl.keyStorePassword","password");
}
}

<bean id="initialiseSSL"
class="com.allocatesoftware.camel.nhsp.hr.SetSystemProperties" />

<bean id="activemqSource"
class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="brokerURL" value="https://localhost:8443"/>
<property name="clientId" value="1"/>
<property name="durableSubscriptionName" value="nhsp11"/>
<property name="acknowledgementModeName" value="AUTO_ACKNOWLEDGE" />
</bean>

Is this correct way or is there a better way of setting trust and keystore
from Camel?




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-route-ActiveMQ-from-http-to-Https-tp5727932p5728040.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message