From d40789208a11faf3cbf3794e9d0cdb5d4c11a36d Mon Sep 17 00:00:00 2001
From: Lizi
Date: Fri, 13 Apr 2018 09:35:13 +0000
Subject: Add skip tls verify when call the API of consul
Change-Id: Ib47f8eef74524e16e4bf205427b0d7be8bd353f5
Issue-ID: MSB-189
Signed-off-by: Lizi
---
.../main/java/org/onap/msb/sdclient/core/AgentService.java | 12 +++++++++++-
.../src/main/java/org/onap/msb/sdclient/core/Node.java | 8 ++++++++
.../org/onap/msb/sdclient/wrapper/ConsulServiceWrapper.java | 2 +-
3 files changed, 20 insertions(+), 2 deletions(-)
(limited to 'sdclient/discovery-service/src/main/java')
diff --git a/sdclient/discovery-service/src/main/java/org/onap/msb/sdclient/core/AgentService.java b/sdclient/discovery-service/src/main/java/org/onap/msb/sdclient/core/AgentService.java
index a5e21e0..225eeaf 100644
--- a/sdclient/discovery-service/src/main/java/org/onap/msb/sdclient/core/AgentService.java
+++ b/sdclient/discovery-service/src/main/java/org/onap/msb/sdclient/core/AgentService.java
@@ -1,5 +1,5 @@
/**
- * Copyright 2016-2017 ZTE, Inc. and others.
+ * Copyright 2016-2018 ZTE, Inc. and others.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
@@ -64,6 +64,8 @@ public class AgentService implements Serializable {
@JsonProperty("Timeout")
private String timeout;
+ @JsonProperty("tls_skip_verify")
+ private Boolean tlsSkipVerify=true;
private String status = "passing";
@@ -115,6 +117,14 @@ public class AgentService implements Serializable {
this.status = status;
}
+ public Boolean getTlsSkipVerify() {
+ return tlsSkipVerify;
+ }
+
+ public void setTlsSkipVerify(Boolean tlsSkipVerify) {
+ this.tlsSkipVerify = tlsSkipVerify;
+ }
+
}
diff --git a/sdclient/discovery-service/src/main/java/org/onap/msb/sdclient/core/Node.java b/sdclient/discovery-service/src/main/java/org/onap/msb/sdclient/core/Node.java
index 1a1d65d..c62484b 100644
--- a/sdclient/discovery-service/src/main/java/org/onap/msb/sdclient/core/Node.java
+++ b/sdclient/discovery-service/src/main/java/org/onap/msb/sdclient/core/Node.java
@@ -141,6 +141,14 @@ public class Node implements Serializable {
this.checkTimeOut = checkTimeOut;
}
+ public Boolean getTls_skip_verify() {
+ return tls_skip_verify;
+ }
+
+ public void setTls_skip_verify(Boolean tls_skip_verify) {
+ this.tls_skip_verify = tls_skip_verify;
+ }
+
}
diff --git a/sdclient/discovery-service/src/main/java/org/onap/msb/sdclient/wrapper/ConsulServiceWrapper.java b/sdclient/discovery-service/src/main/java/org/onap/msb/sdclient/wrapper/ConsulServiceWrapper.java
index 031a723..c999b45 100644
--- a/sdclient/discovery-service/src/main/java/org/onap/msb/sdclient/wrapper/ConsulServiceWrapper.java
+++ b/sdclient/discovery-service/src/main/java/org/onap/msb/sdclient/wrapper/ConsulServiceWrapper.java
@@ -640,7 +640,7 @@ public class ConsulServiceWrapper {
check.setInterval(node.getCheckInterval());
check.setHttp(node.getCheckUrl());
check.setTimeout(node.getCheckTimeOut());
-
+ check.setTlsSkipVerify(node.getTls_skip_verify());
checkMap.put("http", node.getCheckUrl());
checkMap.put("interval", node.getCheckInterval());
checkMap.put("timeout", node.getCheckTimeOut());
--
cgit 1.2.3-korg