WSO2 ESB SSLException Host name verification failed for host

This issue could be solved by changing HostnameVerifier but there can be security vulnerabilities by allowing this. 
<parameter name="HostnameVerifier">AllowAll</parameter>

With the ESB 5.0.0 and upwards, you could achieve this by configuring proxy profiles. You do not need to change the host name verifier parameter to 'AllowAll'.
In the axis2.xml file inside the transportSender, you could configure the proxyProfiles parameter with the following configuration.

<transportSender name="https" class="org.apache.synapse.transport.passthru.PassThroughHttpSSLSender">
        <!--<parameter name="HostnameVerifier">AllowAll</parameter>-->
        <parameter name="non-blocking" locked="false">true</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="proxyProfiles">
            <profile>
                <targetHosts>.*.abc.com</targetHosts>
                <proxyHost>proxy.xyz.com.abc.com</proxyHost>
                <proxyPort>8080</proxyPort>
            </profile>
        </parameter>  
    </transportSender>


Also make sure to point the IP address of the proxy server to a host name with the suffix .abc.com, as in the above sample (proxy.micron.com.quickbase.com).
Example:
In /etc/hosts -

127.0.0.1       proxy.xyz.com.abc.com

Therefore proxy.xyz.com.abc.com will be a verified proxy since it's validating the hosts name with abc.com.

Refer this Link for more information on Configuring proxy profiles in WSO2 ESB




Comments

Popular posts from this blog

How to fix SoapUI freeze in Mac OS

Salesforce Auto generate renewal Opportunity with Line Items (i.e. Opportunity Products)

Salesforce Create multiple child records based on a number field in the parent using flow