optionally disable client auth in gizmo 30/76230/1
authorBansal, Nitin (nb121v) <nitin.bansal@amdocs.com>
Wed, 23 Jan 2019 19:35:24 +0000 (14:35 -0500)
committerBansal, Nitin (nb121v) <nitin.bansal@amdocs.com>
Wed, 23 Jan 2019 19:36:41 +0000 (14:36 -0500)
optionally disable client auth in gizmo

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

index 05160d8..3c8e5f7 100644 (file)
@@ -68,7 +68,12 @@ public class CrudApplication extends SpringBootServletInitializer{// NOSONAR
         props.put("schema.service.ssl.key-store-password", deobfuscatedKeyStorePassword);
         props.put("schema.service.ssl.trust-store-password", deobfuscatedKeyStorePassword);
         
-       
+        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 CrudApplication()
             .configure(new SpringApplicationBuilder(CrudApplication.class).properties(props))
index 2b1f302..68c2aec 100644 (file)
@@ -6,7 +6,6 @@ SERVICE_BEANS=dynamic/conf
 
 server.ssl.key-store=${CONFIG_HOME}/auth/tomcat_keystore
 server.ssl.enabled=true
-server.ssl.client-auth=need
 server.ssl.enabled-protocols=TLSv1.1,TLSv1.2
 
 schema.ingest.file=${CONFIG_HOME}/schema-ingest.properties