How to proxy secure web services (HTTPS SSL/TLS) using Mule's <pattern:web-service-proxy> -


we have cxf web services running locally accessed across https tls/ssl. we'd expose these services externally using mule's <pattern:web-service-proxy>. our question is, can <pattern:web-service-proxy> configured use https?

we have proxied these services across http using <pattern:web-service-proxy>. however, when change web-service-proxy's inboundaddress , outboundaddress attributes (below) http urls https urls error: "the required object/property "tls-key-store" null".

this works:

<pattern:web-service-proxy name="unsecure_ws_proxy"     inboundaddress="http://localhost:80/services/service_common_name"     outboundaddress="http://localhost:8080/app_name/proxied_service_name"  />  

this not work (produces "the required object/property "tls-key-store" null "):

<pattern:web-service-proxy name="secure_ws_proxy"     inboundaddress="https://localhost:443/services/service_common_name"     outboundaddress="https://localhost:8443/app_name/proxied_service_name"  /> 

we've defined <tls:context name="tls_context"> , assume if can <pattern:web-service-proxy> use proxy should work.

is assumption correct, , if how tell <pattern:web-service-proxy> use tls_context we've defined? if wrong in our assumption, simplest approach in mule define pass-thru proxy cxf soap webservices use https protocol?

edit:

we're using mule v.3.6.0.

and in interest of completeness, our tls_context (which don't yet know how associate pattern:web-service-proxy, if that's answer):

<tls:context name="tls_context" doc:name="tls context">     <tls:trust-store path="${ssl.truststore.path}" password="${ssl.truststore.password}"/>     <tls:key-store path="${ssl.keystore.path}" password="${ssl.keystore.password}" keypassword="${ssl.keystore.password}"/> </tls:context> 

answer:

here's complete solution, based on david's accepted response. tls_context not needed. thank david:

<?xml version="1.0" encoding="utf-8"?> <mule      xmlns="http://www.mulesoft.org/schema/mule/core"      xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"     xmlns:http="http://www.mulesoft.org/schema/mule/http"      xmlns:script="http://www.mulesoft.org/schema/mule/scripting"     xmlns:spring="http://www.springframework.org/schema/beans"      xmlns:pattern="http://www.mulesoft.org/schema/mule/pattern"     xmlns:https="http://www.mulesoft.org/schema/mule/https"     xsi:schemalocation="        http://www.mulesoft.org/schema/mule/core         http://www.mulesoft.org/schema/mule/core/current/mule.xsd        http://www.mulesoft.org/schema/mule/http         http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd        http://www.mulesoft.org/schema/mule/pattern         http://www.mulesoft.org/schema/mule/pattern/current/mule-pattern.xsd        http://www.mulesoft.org/schema/mule/scripting         http://www.mulesoft.org/schema/mule/scripting/current/mule-scripting.xsd        http://www.springframework.org/schema/beans         http://www.springframework.org/schema/beans/spring-beans-current.xsd        http://www.mulesoft.org/schema/mule/https         http://www.mulesoft.org/schema/mule/https/3.0/mule-https.xsd">      <https:connector name="httpsconnector">         <!-- not needed          <https:tls-client              path="${ssl.client.keystore.path}"              storepassword="${ssl.client.keystore.password}"/>              -->            <https:tls-key-store              path="${ssl.server.keystore.path}"              keypassword="${ssl.server.keystore.password}"              storepassword="${ssl.server.keystore.password}"/>         <https:tls-server              path="${ssl.server.truststore.path}"              storepassword="${ssl.server.truststore.password}"/>     </https:connector>      <!-- pattern-based configuration introduced in mule v.3.2 decrease "the amount of          noise in configuration files". configuration patterns are, design, not           powerful mule flows or services. have instead been designed ease of use.          (http://www.mulesoft.org/documentation-3.2/display/32x/understanding+configuration+patterns+using+mule) -->      <!-- mule pattern proxies -->     <!-- http -->     <pattern:web-service-proxy name="http_ws_proxy"         inboundaddress="http://localhost:80/services/service_common_name"         outboundaddress="http://localhost:8080/app_name/proxied_service_name"      />     <!-- https -->     <pattern:web-service-proxy name="https_ws_proxy"         inboundaddress="https://localhost:443/services/service_common_name"         outboundaddress="https://localhost:8443/app_name/proxied_service_name"      />  </mule> 

you need configure https connector relevant jks configuration.

example:

<https:connector name="httpsconnector">   <https:tls-key-store path="keystore.jks" keypassword="<your password>"          storepassword="<your password>"/> </https:connector> 

reference: http://www.mulesoft.org/documentation/display/current/https+transport+reference


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -