[ 
https://issues.apache.org/jira/browse/HADOOP-10847?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Kanter updated HADOOP-10847:
-----------------------------------
    Attachment: HADOOP-10847-addendum.patch

I was working on a similar patch for HADOOP-11230 (these sun classes actually 
don't work even in JDK 8), but looks like you beat me to it :)

Anyway, this causes tests in other modules that use {{KeyStoreTestUtil}} to 
fail.  For example, {{TestEncryptedShuffle}}
{noformat}
Running org.apache.hadoop.mapreduce.security.ssl.TestEncryptedShuffle
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.794 sec <<< 
FAILURE! - in org.apache.hadoop.mapreduce.security.ssl.TestEncryptedShuffle
encryptedShuffleWithClientCerts(org.apache.hadoop.mapreduce.security.ssl.TestEncryptedShuffle)
  Time elapsed: 0.342 sec  <<< ERROR!
java.lang.NoClassDefFoundError: org/bouncycastle/x509/X509V1CertificateGenerator
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        at 
org.apache.hadoop.security.ssl.KeyStoreTestUtil.generateCertificate(KeyStoreTestUtil.java:87)
        at 
org.apache.hadoop.security.ssl.KeyStoreTestUtil.setupSSLConfig(KeyStoreTestUtil.java:242)
        at 
org.apache.hadoop.security.ssl.KeyStoreTestUtil.setupSSLConfig(KeyStoreTestUtil.java:207)
        at 
org.apache.hadoop.mapreduce.security.ssl.TestEncryptedShuffle.encryptedShuffleWithCerts(TestEncryptedShuffle.java:135)
        at 
org.apache.hadoop.mapreduce.security.ssl.TestEncryptedShuffle.encryptedShuffleWithClientCerts(TestEncryptedShuffle.java:167)

encryptedShuffleWithoutClientCerts(org.apache.hadoop.mapreduce.security.ssl.TestEncryptedShuffle)
  Time elapsed: 0.133 sec  <<< ERROR!
java.lang.NoClassDefFoundError: org/bouncycastle/x509/X509V1CertificateGenerator
        at 
org.apache.hadoop.security.ssl.KeyStoreTestUtil.generateCertificate(KeyStoreTestUtil.java:87)
        at 
org.apache.hadoop.security.ssl.KeyStoreTestUtil.setupSSLConfig(KeyStoreTestUtil.java:251)
        at 
org.apache.hadoop.security.ssl.KeyStoreTestUtil.setupSSLConfig(KeyStoreTestUtil.java:207)
        at 
org.apache.hadoop.mapreduce.security.ssl.TestEncryptedShuffle.encryptedShuffleWithCerts(TestEncryptedShuffle.java:135)
        at 
org.apache.hadoop.mapreduce.security.ssl.TestEncryptedShuffle.encryptedShuffleWithoutClientCerts(TestEncryptedShuffle.java:172)
{noformat}

This is because they're including hadoop-common's test jar, which does not pull 
in transitive dependencies.  You have to explicitly add bouncycastle as a test 
dependency to each affected module: hadoop-kms, hadoop-hdfs-httpfs, 
hadoop-hdfs, hadoop-mapreduce-client-jobclient, and 
hadoop-yarn-server-applicationhistoryservice.  I've attached an addendum patch 
(HADOOP-10847-addendum.patch) based on my HADOOP-11230 patch that fixes this.  
[~wheat9], can you take a look?  We can either put this in as an addendum here, 
or repurpose HADOOP-11230 for it.

> Remove the usage of sun.security.x509.* in testing code
> -------------------------------------------------------
>
>                 Key: HADOOP-10847
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10847
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: security
>            Reporter: Kai Zheng
>            Assignee: pascal oliva
>            Priority: Minor
>             Fix For: 2.7.0
>
>         Attachments: HADOOP-10847-1.patch, HADOOP-10847-2.patch, 
> HADOOP-10847-3.patch, HADOOP-10847-addendum.patch
>
>
> As was told by Max (Oracle), JDK9 is likely to block all accesses to sun.* 
> classes.
> Below is from email of Andrew Purtell:
> {quote}
> The use of sun.* APIs to create a certificate in Hadoop and HBase test code 
> can be removed. Someone (Intel? Oracle?) can submit a JIRA that replaces the 
> programmatic construction with a stringified binary cert for use in the 
> relevant unit tests. 
> {quote}
> In Hadoop, the calls in question are below:
> {code}
> hadoop-common/src/test/java/org/apache/hadoop/security/ssl/KeyStoreTestUtil.java:24:import
>  sun.security.x509.CertificateIssuerName;
> hadoop-common/src/test/java/org/apache/hadoop/security/ssl/KeyStoreTestUtil.java:25:import
>  sun.security.x509.CertificateSerialNumber;
> hadoop-common/src/test/java/org/apache/hadoop/security/ssl/KeyStoreTestUtil.java:26:import
>  sun.security.x509.CertificateSubjectName;
> hadoop-common/src/test/java/org/apache/hadoop/security/ssl/KeyStoreTestUtil.java:27:import
>  sun.security.x509.CertificateValidity;
> hadoop-common/src/test/java/org/apache/hadoop/security/ssl/KeyStoreTestUtil.java:28:import
>  sun.security.x509.CertificateVersion;
> hadoop-common/src/test/java/org/apache/hadoop/security/ssl/KeyStoreTestUtil.java:29:import
>  sun.security.x509.CertificateX509Key;
> hadoop-common/src/test/java/org/apache/hadoop/security/ssl/KeyStoreTestUtil.java:30:import
>  sun.security.x509.X500Name; 
> hadoop-common/src/test/java/org/apache/hadoop/security/ssl/KeyStoreTestUtil.java:31:import
>  sun.security.x509.X509CertImpl; 
> hadoop-common/src/test/java/org/apache/hadoop/security/ssl/KeyStoreTestUtil.java:32:import
>  sun.security.x509.X509CertInfo;
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to