KNOX-1154 - Dump Kerberos settings upon startup. (Rick Kellogg via Phil Zampino)
authorRick Kellogg <rkellogg@dqtools.com>
Thu, 21 Dec 2017 21:30:58 +0000 (16:30 -0500)
committerPhil Zampino <pzampino@apache.org>
Wed, 16 May 2018 16:58:04 +0000 (12:58 -0400)
gateway-server/src/main/java/org/apache/knox/gateway/GatewayServer.java

index 8ebaff8..2d6011e 100644 (file)
@@ -231,12 +231,16 @@ public class GatewayServer {
   }
 
   private static void configureKerberosSecurity( GatewayConfig config ) {
-    System.setProperty(GatewayConfig.HADOOP_KERBEROS_SECURED, "true");
-    System.setProperty(GatewayConfig.KRB5_CONFIG, config.getKerberosConfig());
-    System.setProperty(GatewayConfig.KRB5_DEBUG,
-        Boolean.toString(config.isKerberosDebugEnabled()));
-    System.setProperty(GatewayConfig.KRB5_LOGIN_CONFIG, config.getKerberosLoginConfig());
-    System.setProperty(GatewayConfig.KRB5_USE_SUBJECT_CREDS_ONLY,  "false");
+    setSystemProperty(GatewayConfig.HADOOP_KERBEROS_SECURED, "true");
+    setSystemProperty(GatewayConfig.KRB5_CONFIG, config.getKerberosConfig());
+    setSystemProperty(GatewayConfig.KRB5_DEBUG, Boolean.toString(config.isKerberosDebugEnabled()));
+    setSystemProperty(GatewayConfig.KRB5_LOGIN_CONFIG, config.getKerberosLoginConfig());
+    setSystemProperty(GatewayConfig.KRB5_USE_SUBJECT_CREDS_ONLY,  "false");
+  }
+
+  private static void setSystemProperty(String name, String value) {
+         System.setProperty(name, value);
+    log.logSysProp(name, System.getProperty(name));
   }
 
   private static Properties loadBuildProperties() {