I need to write my own class to tell mule that https connection to service (wsdl) is verified. I already have mule project nearly finnished but last piece is missing, sending file at specific url.
What I want to achieve:
establish connection and send xml to target url
read response that is also in xml
Server uses security with self signed certificate. What I did so far was that I got cert from that link and imported it in .jks. Then I followed probably all "tutorials" how to connect to server in mule with https connector but nothing worked in my case.
I think that the best thing would be if someone can help me create java class to bypass key checking and return true (as verified). Something like:
URL url = new URL("https://www.google.com");
HttpsURLConnection conn= (HttpsURLConnection) url.openConnection();
conn.setHostnameVerifier(new HostnameVerifier() {
@Override
public boolean verify(String arg0, SSLSession arg1) {
return true;
}
});
How can I do that in mule? I expect that it would be something like this.
I am using current mule version (3.5.0)
Thank you!
EDIT:
My configuration:
<https:connector name="HttpsConnector" cookieSpec="netscape" validateConnections="true" sendBufferSize="0" receiveBufferSize="0" receiveBacklog="0" clientSoTimeout="10000" serverSoTimeout="10000" socketSoLinger="0" doc:name="HTTP\HTTPS" dynamicNotification="true" >
<https:tls-server path="${keystore.path}" storePassword="${keystore.pass}" />
</https:connector>
<sub-flow name="toSOAP" doc:name="toSOAP">
<cxf:proxy-client payload="body" doc:name="SOAP" enableMuleSoapHeaders="false">
<cxf:outInterceptors>
<spring:ref bean="WSS4JOutInterceptorBean"/>
</cxf:outInterceptors>
</cxf:proxy-client>
<https:outbound-endpoint exchange-pattern="one-way" host="${pref.host}" port="${pref.port}" path="${pref.path}" method="POST" connector-ref="HttpsConnector" doc:name="HTTP"/>
</sub-flow>