diff options
author | Serban Popescu <serban.popescu@amdocs.com> | 2019-02-01 14:22:17 -0500 |
---|---|---|
committer | Serban Popescu <serban.popescu@amdocs.com> | 2019-02-04 10:44:29 -0500 |
commit | 0afd8dd50d1a9c141b9135f491de9f8cc83f9b29 (patch) | |
tree | 7c89701df334abafac1ffd014028d8b2f1bea8c4 /src/main/java | |
parent | a46ee0480358b5c10d6fc3ac3c644b0d3d71f1a8 (diff) |
Optionally disable client authentication
based on an env. variable, client authentication can be disabled
Change-Id: I6d787644ef1439b8e88dcc3dec7f5181b11b7f11
Issue-ID: AAI-2132
Signed-off-by: Serban Popescu <serban.popescu@amdocs.com>
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/onap/aai/sa/Application.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/org/onap/aai/sa/Application.java b/src/main/java/org/onap/aai/sa/Application.java index f2b8db1..059ca22 100644 --- a/src/main/java/org/onap/aai/sa/Application.java +++ b/src/main/java/org/onap/aai/sa/Application.java @@ -46,6 +46,13 @@ public class Application 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", Boolean.valueOf(requireClientAuth)? "need" : "want");
+ }
+
new Application().configure(new SpringApplicationBuilder(Application.class).properties(props)).run(args);
}
}
|