From b75cd1c9cb1e21c0dfba006e5fa99801a6aa9710 Mon Sep 17 00:00:00 2001 From: Ryan Goulding Date: Thu, 6 Jul 2017 06:47:28 -0400 Subject: Extract a constant in place of a hardcoded value This is a bit cleaner IMO but open to suggestions. Change-Id: I074f18eb93aee5582629d04c21295a07bc45c089 Signed-off-by: Ryan Goulding --- src/main/java/org/openecomp/restclient/rest/RestClientBuilder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/java/org/openecomp/restclient/rest/RestClientBuilder.java b/src/main/java/org/openecomp/restclient/rest/RestClientBuilder.java index 2dd19ac..0206941 100644 --- a/src/main/java/org/openecomp/restclient/rest/RestClientBuilder.java +++ b/src/main/java/org/openecomp/restclient/rest/RestClientBuilder.java @@ -65,6 +65,7 @@ public class RestClientBuilder { private static final String SSL_PROTOCOL = "TLS"; private static final String KEYSTORE_ALGORITHM = "SunX509"; private static final String KEYSTORE_TYPE = "PKCS12"; + private static final String TRUST_STORE_PROPERTY = "javax.net.ssl.trustStore"; private boolean validateServerHostname; private boolean validateServerCertChain; @@ -198,7 +199,7 @@ public class RestClientBuilder { TrustManager[] trustAllCerts = null; if (validateServerCertChain) { if (truststoreFilename != null) { - System.setProperty("javax.net.ssl.trustStore", truststoreFilename); + System.setProperty(TRUST_STORE_PROPERTY, truststoreFilename); } else { throw new IllegalArgumentException("Trust store filename must be set!"); } -- cgit 1.2.3-korg