How to connect to https server with Mule 2 -



How to connect to https server with Mule 2 -

i used command convert .pem file .jks 1 (source):

keytool -importcert -alias debian -file cert.pem -keystore cert.jks -storepass passwd

here's mule file:

class="lang-xml prettyprint-override"><?xml version="1.0" encoding="utf-8"?> <mule xmlns="http://www.mulesource.org/schema/mule/core/2.2" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:http="http://www.mulesource.org/schema/mule/http/2.2" xmlns:https="http://www.mulesource.org/schema/mule/https/2.2" xsi:schemalocation=" http://www.mulesource.org/schema/mule/http/2.2 http://www.mulesource.org/schema/mule/http/2.2/mule-http.xsd http://www.mulesource.org/schema/mule/https/2.2 http://www.mulesource.org/schema/mule/https/2.2/mule-https.xsd http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule.xsd"> <https:connector name="sslconnector" keepsendsocketopen="true"> <https:tls-client path="${mule.home}/cert.jks" storepassword="passwd"/> </https:connector> <model> <service name="connecttohttps"> <inbound> <http:inbound-endpoint host="localhost" port="9000" synchronous="true"/> </inbound> <outbound> <chaining-router> <outbound-endpoint address="https://localhost" synchronous="true"/> </chaining-router> </outbound> </service> </model> </mule>

now, this:

error 2011-07-08 12:06:51,210 [main] org.mule.muleserver: ******************************************************************************** message : initialisation failure: error creating bean name 'sslconnector': invocation of init method failed; nested exception java.lang.illegalargumentexception: key password cannot null type : org.mule.api.lifecycle.initialisationexception code : mule_error-72085 javadoc : http://www.mulesource.org/docs/site/current2/apidocs/org/mule/api/lifecycle/initialisationexception.html object : org.mule.config.spring.springregistry@160bf50 ******************************************************************************** exception stack is: 1. key password cannot null (java.lang.illegalargumentexception) org.mule.api.security.tls.tlsconfiguration:290 (null) 2. error creating bean name 'sslconnector': invocation of init method failed; nested exception java.lang.illegalargumentexception: key password cannot null (org.springframework.beans.factory.beancreationexception) org.springframework.beans.factory.support.abstractautowirecapablebeanfactory:1338 (null) 3. initialisation failure: error creating bean name 'sslconnector': invocation of init method failed; nested exception java.lang.illegalargumentexception: key password cannot null (org.mule.api.lifecycle.initialisationexception) org.mule.registry.abstractregistry:76 (http://www.mulesource.org/docs/site/current2/apidocs/org/mule/api/lifecycle/initialisationexception.html)

sidenote: expands on is there way connect https server specifying url in mule 2?

after experimenting config, figured tls-key-store element needed.

the next https configuration allows "connecttohttps" nail https outbound target:

<https:connector name="sslconnector" keepsendsocketopen="true"> <https:tls-client path="${mule.home}/cert.jks" storepassword="passwd"/> <https:tls-key-store path="${mule.home}/cert.jks" keypassword="passwd" storepassword="passwd" /> </https:connector>

https mule

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -