authenticationsslhttpsdroolspreemptive

Drools JBPM Process - Make REST call to an SSL authenticated API


There is able to make a REST call from JBPM process to an API without SSL authenticated by using REST WorkItemHandler. I pretty sure how to do that. The problem is how to make a REST call to HTTPS API, i have tried many times with the REST WorkItemHandler input parameters, but got no chances.

The returned error:

"Unable to create response: [AAA.AAAProcess:72 - Insert Request:5] -- org.jbpm.workflow.instance.WorkflowRuntimeException: [.AAAProcess:72 - Request Validation:4] -- [AAA.AAAProcess:72 - IP Address Validation:16] -- org.jbpm.workflow.instance.WorkflowRuntimeException: [AAA.AAAProcess:72 - Email Domain Validation:9] -- org.jbpm.workflow.instance.WorkflowRuntimeException: [AAA.AAAProcess:72 - Phone Number Validation:11] -- org.jbpm.workflow.instance.WorkflowRuntimeException: [AAA.AAAProcess:72 - Burst Pattern Validation:14] -- org.jbpm.workflow.instance.WorkflowRuntimeException: [AAA.AAAProcess:72 - Rest:8] -- java.lang.RuntimeException: Could not execute request with preemptive authentication [GET] https://xxx.xx.xxx.xx:xxxx/somthing/something.tml"

Does any one met this issue. Can we discuss. Would be appreciated


Solution

  • I found out that if you need to make a REST call by using RESTWorkItemHandler to an SSL API, you must enable Wildfly truststore, the truststore that contains the keystore of the SSL API.

    1. You must create Wildfly truststore "truststore.jks" into "/wildfly/standalone/configuration/" folder
    2. Import the API SSL certificate of server that you want to make a Rest Call, into Wildfly trusrtstore "truststore.jks" above.
    3. Open standalone.conf file existing in /wildfly/bin, then add config as below: https://i.sstatic.net/v7QsZ.png

    That above config show Wildfly where to find the truststore file, what is the truststore type, and the truststore access password. Restart Wildfly and recall Process REST API.

    GOODLUCK