0

I run ant eclipse-files, but the following weird error, can anyone help me ? Thanks

[get] Error getting http://downloads.sourceforge.net/project/ant-eclipse/ant-eclipse/1.0/ant-eclipse-1.0.bin.tar.bz2 to /Users/jzhang/github/pig/build/ant-eclipse-1.0.bin.tar.bz2

BUILD FAILED
/Users/jzhang/github/pig/build.xml:311: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
    at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1937)
    at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302)
    at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)
    at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1478)
    at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:212)
    at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979)
    at sun.security.ssl.Handshaker.process_record(Handshaker.java:914)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1050)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1363)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1391)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1375)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:153)
    at org.apache.tools.ant.taskdefs.Get$GetThread.openConnection(Get.java:712)
    at org.apache.tools.ant.taskdefs.Get$GetThread.openConnection(Get.java:737)
    at org.apache.tools.ant.taskdefs.Get$GetThread.openConnection(Get.java:737)
    at org.apache.tools.ant.taskdefs.Get$GetThread.get(Get.java:626)
    at org.apache.tools.ant.taskdefs.Get$GetThread.run(Get.java:616)

And I follow the instructions of link here And After that I can run this command successfully.

keytool -list -keystore "$JAVA_HOME/jre/lib/security/cacerts"

Here's the screenshot of key explorer. But I can still see the error above. enter image description here

Community
  • 1
  • 1
zjffdu
  • 25,496
  • 45
  • 109
  • 159

1 Answers1

0

Please refer this answer for your reference.

You need to install your network Root ssl certificate to your cacerts file.

But key is to find jre which is giving you this error!So make sure about 2 things

  1. Install certificate to cacart file of jre which eclipse is using

Got to preferences => ANT=> runtime => Global Entries

screen

you may see JDK of which tool.lib is getting used by ant.

  1. certificate is root certificate
  2. Please confirm you are using /JDKPATH/jre/lib/security/cacerts "NOT THE /JDKPATH/lib/cacerts"

  3. use keystore explorer instead of command line.

Community
  • 1
  • 1
positivecrux
  • 1,307
  • 2
  • 16
  • 35
  • I do these 2 steps, but unfortunately still hit the issue. I am sure that I am doing it in the right JDK. – zjffdu Jan 16 '17 at 08:17
  • I can also run successfull with the following command: "java SSLPoke downloads.sourceforge.net 443" Successfully connected – zjffdu Jan 16 '17 at 08:22
  • @zjffdu Updated answer with detailed. Yes what you find out may work but this is permanent solution! not only for eclipse but almost every java tool which requests https download. – positivecrux Jan 16 '17 at 09:36