summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/pom.xml5
-rw-r--r--utils/src/main/java/org/onap/policy/common/utils/network/NetworkUtil.java27
2 files changed, 7 insertions, 25 deletions
diff --git a/utils/pom.xml b/utils/pom.xml
index 846d6871..95ea2c39 100644
--- a/utils/pom.xml
+++ b/utils/pom.xml
@@ -61,6 +61,11 @@
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
+ <groupId>commons-net</groupId>
+ <artifactId>commons-net</artifactId>
+ <version>3.6</version>
+ </dependency>
+ <dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
diff --git a/utils/src/main/java/org/onap/policy/common/utils/network/NetworkUtil.java b/utils/src/main/java/org/onap/policy/common/utils/network/NetworkUtil.java
index 4b823fdc..a2fb5a8b 100644
--- a/utils/src/main/java/org/onap/policy/common/utils/network/NetworkUtil.java
+++ b/utils/src/main/java/org/onap/policy/common/utils/network/NetworkUtil.java
@@ -26,9 +26,8 @@ import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.UnknownHostException;
-import java.security.cert.X509Certificate;
import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
+import org.apache.commons.net.util.TrustManagerUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -48,29 +47,7 @@ public class NetworkUtil {
/**
* A trust manager that always trusts certificates.
*/
- // @formatter:off
- private static final TrustManager[] ALWAYS_TRUST_MANAGER = new TrustManager[] {
- new X509TrustManager() {
-
- @Override
- public X509Certificate[] getAcceptedIssuers() {
- return new X509Certificate[0];
- }
-
- @Override
- public void checkClientTrusted(final java.security.cert.X509Certificate[] certs,
- final String authType) {
- // always trust
- }
-
- @Override
- public void checkServerTrusted(final java.security.cert.X509Certificate[] certs,
- final String authType) {
- // always trust
- }
- }
- };
- // @formatter:on
+ private static final TrustManager[] ALWAYS_TRUST_MANAGER = { TrustManagerUtils.getAcceptAllTrustManager() };
private NetworkUtil() {
// Empty constructor