From 01e05b877d2c18cdd63561d359350a35ecdd0a10 Mon Sep 17 00:00:00 2001 From: "Bansal, Nitin (nb121v)" Date: Thu, 24 Jan 2019 16:55:10 -0500 Subject: optionally disable client auth optionally disable client auth Change-Id: Ic81a1cbc4c7140696662388e120d6dcaadc2588a Issue-ID: AAI-2116 Signed-off-by: Bansal, Nitin (nb121v) --- champ-service/src/main/java/org/onap/champ/ChampApplication.java | 8 ++++++++ champ-service/src/main/resources/application.properties | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'champ-service/src') diff --git a/champ-service/src/main/java/org/onap/champ/ChampApplication.java b/champ-service/src/main/java/org/onap/champ/ChampApplication.java index 4477006..da4f634 100644 --- a/champ-service/src/main/java/org/onap/champ/ChampApplication.java +++ b/champ-service/src/main/java/org/onap/champ/ChampApplication.java @@ -56,6 +56,14 @@ public class ChampApplication extends SpringBootServletInitializer { props.put("server.ssl.trust-store-password", trustStorePassword); } + String requireClientAuth = System.getenv("REQUIRE_CLIENT_AUTH"); + if (requireClientAuth == null || requireClientAuth.isEmpty()) { + props.put("server.ssl.client-auth", "need"); + }else { + props.put("server.ssl.client-auth",requireClientAuth.equals("true")?"need":"want"); + } + + new ChampApplication().configure(new SpringApplicationBuilder(ChampApplication.class).properties(props)) .run(args); } diff --git a/champ-service/src/main/resources/application.properties b/champ-service/src/main/resources/application.properties index e08e249..8f152e9 100644 --- a/champ-service/src/main/resources/application.properties +++ b/champ-service/src/main/resources/application.properties @@ -5,6 +5,5 @@ SERVICE_BEANS=dynamic/conf server.ssl.key-store=${CONFIG_HOME}/auth/tomcat_keystore server.ssl.key-store-type=JKS server.ssl.enabled=true -server.ssl.client-auth=need logging.config=classpath:logback.xml -- cgit 1.2.3-korg