Introduction
This short post explains how to test two-way-ssl using postman. The same principle applies to SoapUI. For details about how to create two-way-ssl service will be explained in later post.
Assumption
- You have client.keystore.jks and client.truststore.jks.
- You have tested both file using restclient
JKS To PCS12
keytool -importkeystore -srckeystore client.keystore.jks -destkeystore client.p12 -srcstoretype JKS -deststoretype PKCS12 -deststorepass clientpass -srcstorepass clientpass -srcalias mule-client -destalias mule-client
Import client.p12 To KeyChain
Open KeyChain Access (MacOs) File -> Import Items Now Search for the alis "mule-client"Test Using Postman
In my case, I use this url for two ssl: https://localhost:8543/twoway. When I send a POST request, postman will as certificates to send to the server as the following: Choose "localhost" one.Test Using curl
Local Host Test
URL: https://localhost:8543/twoway curl -k --cert client.p12:clientpass \ -X POST -H "Content-Type: application/json" \ -d '{"name": "Gary Liu"}' \ https://localhost:8543/twoway
Test For CloudHub
CloudHub behave different for two-ssl. The port will be 8082, regardless what you set in the file of mule.dev.propertiesURL: https://mule-worker-twowayssl-poc.cloudhub.io:8082/twoway curl -k --cert client.p12:clientpass \ -X POST -H "Content-Type: application/json" \ -d '{"name": "Gary Liu"}' \ https://mule-worker-twowayssl-poc.cloudhub.io:8082/twoway
Very nice information on Mulesoft. You can also check goformule for mulesoft tutorials
ReplyDeleteThank for sharing useful post with us.
ReplyDeleteMulesoft Online Training
Mulesoft Training in Hyderabad
Thanks Gary for the post.
ReplyDeleteI'm getting the following error when I'm testing with curl command,
"curl: (58) could not load PEM client certificate, OpenSSL error error:0909006C:PEM routines:get_name:no start line, (no key found, wrong pass phrase, or wrong file format?)"
Very nice article,keep sharing it more.
ReplyDeleteThank you.
ServiceNow Admin Online Training
Such a Wonderful Information
ReplyDeleteSAP GRC
Igrowsoft solutions