diff --git a/miniloan-server/src/main/java/com/ibm/odm/samples/RESTJSONJavaClient.java b/miniloan-server/src/main/java/com/ibm/odm/samples/RESTJSONJavaClient.java index 5b28415..9f4e212 100644 --- a/miniloan-server/src/main/java/com/ibm/odm/samples/RESTJSONJavaClient.java +++ b/miniloan-server/src/main/java/com/ibm/odm/samples/RESTJSONJavaClient.java @@ -28,8 +28,10 @@ import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; +import org.apache.http.ssl.SSLContexts; public class RESTJSONJavaClient { @@ -40,7 +42,13 @@ public class RESTJSONJavaClient { * @throws Exception */ public static synchronized CloseableHttpClient getClient() throws Exception { - CloseableHttpClient client = HttpClients.createDefault(); + SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory( + SSLContexts.createDefault(), + new String[] { "TLSv1.2" }, + null, + SSLConnectionSocketFactory.getDefaultHostnameVerifier()); + + CloseableHttpClient client = HttpClients.custom().setSSLSocketFactory(sslsf).build(); return client; } diff --git a/miniloan-server/src/main/java/com/ibm/odm/samples/Validate.java b/miniloan-server/src/main/java/com/ibm/odm/samples/Validate.java index a09118e..05f8451 100644 --- a/miniloan-server/src/main/java/com/ibm/odm/samples/Validate.java +++ b/miniloan-server/src/main/java/com/ibm/odm/samples/Validate.java @@ -102,9 +102,7 @@ public String validate(JsonObject json) { String result = ""; String server = json.getString("server"); String ruleset = json.getString("ruleset"); - String instanceType = json.getString("instanceType"); - String url = "https://" + server +"/odm/" + - instanceType + "/DecisionService/rest/v1/" + ruleset; + String url = server + "/rest/v1/" + ruleset; boolean showTrace = (boolean) json.getBoolean("showTrace"); result = validateWithJRules(loan, borrower, url, json, showTrace); System.out.println(result); diff --git a/miniloan-server/src/main/webapp/index.html b/miniloan-server/src/main/webapp/index.html index f048582..c8c2582 100644 --- a/miniloan-server/src/main/webapp/index.html +++ b/miniloan-server/src/main/webapp/index.html @@ -68,10 +68,10 @@
Loan request approval application
Calls the ODM on cloud execution server to run a decision to approve or not a loan request.
+Run a decision to approve or not a loan request through ODM on Cloud or CP4BA aaS Decision Service.