I am using same environment described in my previous blog for this tutorial
Configure WSO2 ESB Server
1) Edit https transportReceiver in axis2.xml, which is located in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<transportReceiver name="https" class="org.apache.synapse.transport.passthru.PassThroughHttpSSLListener"> | |
<parameter name="port" locked="false">8243</parameter> | |
<parameter name="non-blocking" locked="false">true</parameter> | |
<parameter name="httpGetProcessor" locked="false">org.wso2.carbon.transport.nhttp.api.PassThroughNHttpGetProcessor</parameter> | |
<parameter name="keystore" locked="false"> | |
<KeyStore> | |
<Location>repository/resources/security/wso2carbon.jks</Location> | |
<Type>JKS</Type> | |
<Password>wso2carbon</Password> | |
<KeyPassword>wso2carbon</KeyPassword> | |
</KeyStore> | |
</parameter> | |
<parameter name="truststore" locked="false"> | |
<TrustStore> | |
<Location>repository/resources/security/client-truststore.jks</Location> | |
<Type>JKS</Type> | |
<Password>wso2carbon</Password> | |
</TrustStore> | |
</parameter> | |
<parameter name="SSLVerifyClient">optional</parameter> | |
<!--supports optional|require or defaults to none --> | |
</transportReceiver> |
Note: This will make Mutual SSL optional for proxy services exposed on https transport.
Now you will able to Invoke Test Proxy without SSL KeyStore property in SOAP UI. To verify this remove value of SSL KeyStore and Invoke Request 1 Again.
Enable Mutual SSL for Test Proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<wsp:Policy wsu:Id="MutualSSL" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> | |
<wsp:ExactlyOne> | |
<wsp:All> | |
<sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"> | |
<wsp:Policy> | |
<sp:TransportToken> | |
<wsp:Policy> | |
<sp:HttpsToken RequireClientCertificate="true"/> | |
</wsp:Policy> | |
</sp:TransportToken> | |
<sp:AlgorithmSuite> | |
<wsp:Policy> | |
<sp:Basic256/> | |
</wsp:Policy> | |
</sp:AlgorithmSuite> | |
<sp:Layout> | |
<wsp:Policy> | |
<sp:Lax/> | |
</wsp:Policy> | |
</sp:Layout> | |
</wsp:Policy> | |
</sp:TransportBinding> | |
<rampart:RampartConfig xmlns:rampart="http://ws.apache.org/rampart/policy"> | |
<rampart:encryptionUser>useReqSigCert</rampart:encryptionUser> | |
<rampart:timestampPrecisionInMilliseconds>true</rampart:timestampPrecisionInMilliseconds> | |
<rampart:timestampTTL>300</rampart:timestampTTL> | |
<rampart:timestampMaxSkew>300</rampart:timestampMaxSkew> | |
<rampart:tokenStoreClass>org.wso2.carbon.security.util.SecurityTokenStore</rampart:tokenStoreClass> | |
<rampart:nonceLifeTime>300</rampart:nonceLifeTime> | |
</rampart:RampartConfig> | |
</wsp:All> | |
</wsp:ExactlyOne> | |
</wsp:Policy> |
2) Add following parameters to Test Proxy.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<enableSec/> | |
<policy key="MutualSSLPolicy.xml"/> |
3) Final Test proxy will look like this
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<proxy xmlns="http://ws.apache.org/ns/synapse" | |
name="Test" | |
transports="https" | |
statistics="disable" | |
trace="disable" | |
startOnLoad="true"> | |
<target> | |
<inSequence> | |
<log level="full"/> | |
<respond/> | |
</inSequence> | |
</target> | |
<enableSec/> | |
<policy key="MutualSSLPolicy.xml"/> | |
<description/> | |
</proxy> | |
Testing With SOAP UI
1) Try Request 1 without SSL KeyStore parameter. Request Fails with SOAP Fault2) Now try with SSL KeyStore Parameter, Now you will able to invoke Test Proxy Service.