diff options
author | KAPIL SINGAL <ks220y@att.com> | 2021-07-21 13:55:15 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-07-21 13:55:15 +0000 |
commit | 6c419f4b9ab0bffff4b56d4c4115551b41199858 (patch) | |
tree | e38ac264d8defae6fca7c4c670ea3c9334aed9ae /plugins/restapi-call-node/provider | |
parent | ec15710c693074865c04d546fe994d7861791089 (diff) | |
parent | afb648cbb6e69725f5f0857f5429cf710c8a0243 (diff) |
Merge "Fix weak crypto issue in restconf adaptor"
Diffstat (limited to 'plugins/restapi-call-node/provider')
2 files changed, 3 insertions, 1 deletions
diff --git a/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java b/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java index 9b542af91..6e84a9c02 100755 --- a/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java +++ b/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/Parameters.java @@ -53,4 +53,5 @@ public class Parameters { public boolean multipartFormData; public String multipartFile; public String targetEntity; + public boolean disableHostVerification; } diff --git a/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index f1aa2b266..e3192562d 100755 --- a/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -238,6 +238,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { p.multipartFormData = valueOf(parseParam(paramMap, "multipartFormData", false, "false")); p.multipartFile = parseParam(paramMap, "multipartFile", false, null); p.targetEntity = parseParam(paramMap, "targetEntity", false, null); + p.disableHostVerification = valueOf(parseParam(paramMap, "disableHostVerification", false, "true")); return p; } @@ -925,7 +926,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { protected SSLContext createSSLContext(Parameters p) { try (FileInputStream in = new FileInputStream(p.keyStoreFileName)) { - HttpsURLConnection.setDefaultHostnameVerifier(new AcceptIpAddressHostNameVerifier()); + HttpsURLConnection.setDefaultHostnameVerifier(new AcceptIpAddressHostNameVerifier(p.disableHostVerification)); KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); KeyStore ks = KeyStore.getInstance("PKCS12"); char[] pwd = p.keyStorePassword.toCharArray(); |