Browse Source

HADOOP-10639. FileBasedKeyStoresFactory initialization is not using default for SSL_REQUIRE_CLIENT_CERT_KEY. (tucu)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1598413 13f79535-47bb-0310-9956-ffa450edef68
Alejandro Abdelnur 11 years ago
parent
commit
04b0f6851b

+ 3 - 0
hadoop-common-project/hadoop-common/CHANGES.txt

@@ -516,6 +516,9 @@ Release 2.5.0 - UNRELEASED
     HADOOP-10602. Documentation has broken "Go Back" hyperlinks.
     HADOOP-10602. Documentation has broken "Go Back" hyperlinks.
     (Akira AJISAKA via cnauroth)
     (Akira AJISAKA via cnauroth)
 
 
+    HADOOP-10639. FileBasedKeyStoresFactory initialization is not using default
+    for SSL_REQUIRE_CLIENT_CERT_KEY. (tucu)
+
 Release 2.4.1 - UNRELEASED
 Release 2.4.1 - UNRELEASED
 
 
   INCOMPATIBLE CHANGES
   INCOMPATIBLE CHANGES

+ 2 - 1
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ssl/FileBasedKeyStoresFactory.java

@@ -131,7 +131,8 @@ public class FileBasedKeyStoresFactory implements KeyStoresFactory {
     throws IOException, GeneralSecurityException {
     throws IOException, GeneralSecurityException {
 
 
     boolean requireClientCert =
     boolean requireClientCert =
-      conf.getBoolean(SSLFactory.SSL_REQUIRE_CLIENT_CERT_KEY, true);
+      conf.getBoolean(SSLFactory.SSL_REQUIRE_CLIENT_CERT_KEY,
+          SSLFactory.DEFAULT_SSL_REQUIRE_CLIENT_CERT);
 
 
     // certificate store
     // certificate store
     String keystoreType =
     String keystoreType =

+ 13 - 0
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/ssl/TestSSLFactory.java

@@ -272,4 +272,17 @@ public class TestSSLFactory {
       sslFactory.destroy();
       sslFactory.destroy();
     }
     }
   }
   }
+
+  @Test
+  public void testNoClientCertsInitialization() throws Exception {
+    Configuration conf = createConfiguration(false);
+    conf.unset(SSLFactory.SSL_REQUIRE_CLIENT_CERT_KEY);
+    SSLFactory sslFactory = new SSLFactory(SSLFactory.Mode.CLIENT, conf);
+    try {
+      sslFactory.init();
+    } finally {
+      sslFactory.destroy();
+    }
+  }
+
 }
 }