summaryrefslogtreecommitdiffstats
path: root/catalog-fe
diff options
context:
space:
mode:
authorMichaelMorris <michael.morris@est.tech>2023-10-27 16:40:40 +0100
committerVasyl Razinkov <vasyl.razinkov@est.tech>2023-10-27 17:02:54 +0000
commit9405a1e62aa6d46d4e94f26d5496319e0ee68a6a (patch)
tree04b36578b6d8642108d172cc258c64686d23c20f /catalog-fe
parent551b613aeee1747ee94156396c1f99b31133681e (diff)
Fix exception in healthcheck with http
Signed-off-by: MichaelMorris <michael.morris@est.tech> Issue-ID: SDC-4674 Change-Id: I49e053c17018eb1bd824b4eb120c27b99266e521
Diffstat (limited to 'catalog-fe')
-rw-r--r--catalog-fe/src/main/java/org/openecomp/sdc/fe/impl/HealthCheckScheduledTask.java21
1 files changed, 16 insertions, 5 deletions
diff --git a/catalog-fe/src/main/java/org/openecomp/sdc/fe/impl/HealthCheckScheduledTask.java b/catalog-fe/src/main/java/org/openecomp/sdc/fe/impl/HealthCheckScheduledTask.java
index 0db9fe9a44..c7c0e9e4e6 100644
--- a/catalog-fe/src/main/java/org/openecomp/sdc/fe/impl/HealthCheckScheduledTask.java
+++ b/catalog-fe/src/main/java/org/openecomp/sdc/fe/impl/HealthCheckScheduledTask.java
@@ -147,11 +147,22 @@ public class HealthCheckScheduledTask implements Runnable {
private ClientCertificate getHttpClientCertificate() {
ClientCertificate clientCertificate = new ClientCertificate();
- clientCertificate.setKeyStore(JettySSLUtils.getSSLConfig().getKeystorePath());
- clientCertificate.setKeyStorePassword(JettySSLUtils.getSSLConfig().getKeystorePass(), false);
- clientCertificate.setTrustStore(JettySSLUtils.getSSLConfig().getTruststorePath());
- clientCertificate.setTrustStorePassword(JettySSLUtils.getSSLConfig().getTruststorePass());
- return clientCertificate;
+ boolean certificateInfoConfigured = false;
+ if (StringUtils.isNotBlank(JettySSLUtils.getSSLConfig().getKeystorePath())) {
+ clientCertificate.setKeyStore(JettySSLUtils.getSSLConfig().getKeystorePath());
+ if (StringUtils.isNotBlank(JettySSLUtils.getSSLConfig().getKeystorePass())) {
+ clientCertificate.setKeyStorePassword(JettySSLUtils.getSSLConfig().getKeystorePass(), false);
+ }
+ certificateInfoConfigured = true;
+ }
+ if (StringUtils.isNotBlank(JettySSLUtils.getSSLConfig().getTruststorePath())) {
+ clientCertificate.setTrustStore(JettySSLUtils.getSSLConfig().getTruststorePath());
+ if (StringUtils.isNotBlank(JettySSLUtils.getSSLConfig().getTruststorePass())) {
+ clientCertificate.setTrustStorePassword(JettySSLUtils.getSSLConfig().getTruststorePass());
+ }
+ certificateInfoConfigured = true;
+ }
+ return certificateInfoConfigured ? clientCertificate: null;
}
private String getExternalComponentHcUri(String baseComponent) {