diff options
author | Jorge Hernandez <jh1730@att.com> | 2018-07-28 22:00:06 -0500 |
---|---|---|
committer | Jorge Hernandez <jh1730@att.com> | 2018-07-28 22:03:04 -0500 |
commit | 3db195c6267ee834007b961ca7ab4ba96377200f (patch) | |
tree | 3f7f2db8297d91dec93b333a8370ebc26e46a66d /policy-endpoints/src/main/java/org | |
parent | c36939ee0e648f4ac28b9cdc538991ced0c603bd (diff) |
support ueb/dmaap https related configuration
Change-Id: Ide2e3524cbbf0a8caf36ad48c003b7500482ad4a
Issue-ID: POLICY-941
Signed-off-by: Jorge Hernandez <jh1730@att.com>
Diffstat (limited to 'policy-endpoints/src/main/java/org')
3 files changed, 11 insertions, 5 deletions
diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineDmaapTopicSink.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineDmaapTopicSink.java index 2ad8bb34..c630a165 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineDmaapTopicSink.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineDmaapTopicSink.java @@ -104,7 +104,7 @@ public class InlineDmaapTopicSink extends InlineBusTopicSink implements DmaapTop public void init() { if (allNullOrEmpty(this.environment, this.aftEnvironment, this.latitude, this.longitude, this.partner)) { this.publisher = new CambriaPublisherWrapper(this.servers, this.topic, this.apiKey, this.apiSecret, - this.userName, this.password, this.useHttps); + this.userName, this.password, this.useHttps, this.allowSelfSignedCerts); } else { this.publisher = new DmaapDmePublisherWrapper(this.servers, this.topic, this.userName, this.password, this.environment, this.aftEnvironment, this.partner, this.latitude, this.longitude, diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineUebTopicSink.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineUebTopicSink.java index 24cf6073..34dd4e74 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineUebTopicSink.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineUebTopicSink.java @@ -64,7 +64,8 @@ public class InlineUebTopicSink extends InlineBusTopicSink implements UebTopicSi public void init() { this.publisher = - new CambriaPublisherWrapper(this.servers, this.topic, this.apiKey, this.apiSecret, this.useHttps); + new CambriaPublisherWrapper(this.servers, this.topic, this.apiKey, this.apiSecret, + null, null, this.useHttps, this.allowSelfSignedCerts); logger.info("{}: UEB SINK created", this); } diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/impl/CambriaPublisherWrapper.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/impl/CambriaPublisherWrapper.java index ab5868ab..7902d4be 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/impl/CambriaPublisherWrapper.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/impl/CambriaPublisherWrapper.java @@ -20,6 +20,7 @@ package org.onap.policy.common.endpoints.event.comm.bus.internal.impl; +import com.att.nsa.apiClient.http.HttpClient.ConnectionType; import com.att.nsa.cambria.client.CambriaBatchingPublisher; import com.att.nsa.cambria.client.CambriaClientBuilders; import com.att.nsa.cambria.client.CambriaClientBuilders.PublisherBuilder; @@ -48,11 +49,11 @@ public class CambriaPublisherWrapper implements BusPublisher { public CambriaPublisherWrapper(List<String> servers, String topic, String apiKey, String apiSecret, boolean useHttps) { - this(servers, topic, apiKey, apiSecret, null, null, useHttps); + this(servers, topic, apiKey, apiSecret, null, null, useHttps, false); } public CambriaPublisherWrapper(List<String> servers, String topic, String apiKey, String apiSecret, String username, - String password, boolean useHttps) { + String password, boolean useHttps, boolean selfSignedCerts) { PublisherBuilder builder = new CambriaClientBuilders.PublisherBuilder(); @@ -62,7 +63,11 @@ public class CambriaPublisherWrapper implements BusPublisher { builder.withSocketTimeout(30000); if (useHttps) { - builder.usingHttps(); + if (selfSignedCerts) { + builder.withConnectionType(ConnectionType.HTTPS_NO_VALIDATION); + } else { + builder.withConnectionType(ConnectionType.HTTPS); + } } |