Integrate With Mutual Certificate Authentication based Service

There are many ways to secure a Service/API using different Authentication mechanisms. Mutual Certificate authentication(AKA: Client Certificate Authentication) is one of the ways to secure Service or API.

Recently I was trying to integrate with an API which is secured using Mutual Certificate Authentication. In this scenario, the backend service team gave me their certificate-based on PKCS#12.

When integrating this backend system with WSO2 Platform, we have to use 'Multi-HTTPS transport'. With this 'Multi-HTTPS transport', it will grant great flexibility to define different SSL profiles with separate trust stores and key stores for different IPs or hosts. This custom SSL profile can be implemented for Client to Synapse Runtime(Client --> ESB) or Synapse Runtime to Backend(ESB --> Backend). If it is Client to ESB, then you have to define custom SSL Profiles in the transportReceiver section.

In my use-case, it was for ESB to Backend. So I had to add custom SSL profiles into the transportSender section of the axis2.xml file. Since I have a PKCS#12 based certificate file, I don't need to convert it to JKS or anything.

Let's assume Mutual Certificate Authentication based backend API URL is The Custom SSL profiles configuration in the axis2.xml(or senderprofiles.xml in WSO2 EI 7) is like below.

<transportSender name="https" class="org.apache.synapse.transport.passthru.PassThroughHttpSSLSender">
	<parameter name="non-blocking" locked="false">true</parameter>
	<parameter name="keystore" locked="false">
	<parameter name="truststore" locked="false">
	<parameter name="customSSLProfiles">
	<!--<parameter name="HostnameVerifier">DefaultAndLocalhost</parameter>-->
	<!--supports Strict|AllowAll|DefaultAndLocalhost or the default if none specified -->


Multi-HTTPS Transport -  WSO2 ESB/EI


Popular posts from this blog

Building a RESTFul Service using Spring Boot

Yield Price Sri Lanka - Android Application

Secure Spring Boot REST API using Basic Authentication