optionally disable client auth 19/76319/1
authorBansal, Nitin (nb121v) <nitin.bansal@amdocs.com>
Thu, 24 Jan 2019 21:55:10 +0000 (16:55 -0500)
committerBansal, Nitin (nb121v) <nitin.bansal@amdocs.com>
Thu, 24 Jan 2019 21:56:42 +0000 (16:56 -0500)
optionally disable client auth

Change-Id: Ic81a1cbc4c7140696662388e120d6dcaadc2588a
Issue-ID: AAI-2116
Signed-off-by: Bansal, Nitin (nb121v) <nitin.bansal@amdocs.com>
champ-service/src/main/java/org/onap/champ/ChampApplication.java
champ-service/src/main/resources/application.properties

index 4477006..da4f634 100644 (file)
@@ -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);
     }
index e08e249..8f152e9 100644 (file)
@@ -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