20

I am trying to download kotlin plugin for eclipse. I am able to connect to eclipse marketplace, but when i try to download it, I get an error:

Unable to read repository at 
https://dl.bintray.com/jetbrains/kotlin/eclipse-plugin/last/content.xml.

sun.security.validator.ValidatorException: PKIX path building failed: 
sun.security.provider.certpath.SunCertPathBuilderException: 
unable to find valid certification path to requested target

I am behind a firewall and proxy settings are configured. I downloaded a certificate from this website and added it to keytool but the error is still the same. How I can resolve this error or install this plugin manually?

nhaarman
  • 98,571
  • 55
  • 246
  • 278
magic_turtle
  • 1,243
  • 3
  • 17
  • 37
  • Which version of Eclipse are you using? – Gabor Szarnyas Nov 18 '16 at 02:34
  • It is Eclipse Neon.1 – magic_turtle Nov 18 '16 at 02:46
  • 1
    1. There is a [related question](https://www.jfrog.com/knowledge-base/how-to-resolve-unable-to-find-valid-certification-path-to-requested-target-error/) in the in the knowledge base of JFrog (the company behind Bintray), which suggests updating the JVM as a step - which version are using? 2. Do other update sites, such as the ones on eclipse.org work? – Gabor Szarnyas Nov 18 '16 at 03:01
  • Thank you for the link! I was able to resolve my issue by appending -Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4 to the end of eclipse.ini file. Found out about it here: http://stackoverflow.com/a/33631964/4447655 I will look at your link as well, thank you! Other updates worked. – magic_turtle Nov 18 '16 at 03:14
  • Don't edit the solution into your question. Answer your own question instead. – The SE I loved is dead Nov 18 '16 at 03:17
  • A dirty workaround: try the plugin url with http instead of https (worked for me for https://download.erlide.org/update) – Fernando Gonzalez Sanchez Sep 28 '18 at 02:16
  • In Eclipse preferences set network connections to direct. "Windows" → "Preferences" → "Network Connections" and set "Active Provider" to "Direct" – Tarun Kumar Jun 18 '19 at 11:55

6 Answers6

24

Given exception is very clear:

sun.security.validator.ValidatorException

meaning that certificate that eclipse gets doesn't match with the host that eclipse talks to - or a variation of this story. This is due to corporate environments where your workstation is intercepted by proxy, firewall or something that inspects https traffic.

1. Add intercepting certificate to cacerts of java

Use command line to add "intercepting certificates" (see ps) into java cacerts keystore (or use some GUI like "KeyStore Explorer" or whatever google gives).

2. Fix eclipse.ini and add below "-vmargs":

-Djavax.net.ssl.trustStore=cacerts 
-Djavax.net.ssl.trustStorePassword=changeit

Note: use full path for "cacerts", I keep cacerts in eclipse folder. Avoid spaces and absolutely no quotes or you run into trustAnchors exception.

Now market store and "install new software" should work as it did for me. Good luck.

PS: To find intercepting certificate, open browser, go to stackoverflow.com, click on browser lock icon next to https sign, download all certificates you find and save them as file pem/cer. Import these into cacerts.

PS: More details on command line, trustAnchors exception because of quotes and spaces, here: stackoverflow and stackoverflow.

Remark to title and answer: -Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4 - is not addressing explained exception. It solves other type of problem. And title should be "Can't install Eclipse plugins due to certificate validation exception".

Peter
  • 566
  • 4
  • 14
7

Was able to solve the issue by appending the following to the eclipse.ini:

-Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4

Found the above solution here: https://stackoverflow.com/a/33631964/4447655 There is also solution if this still does not work, to uncheck SOCKS in the eclipse proxy settings.

Community
  • 1
  • 1
magic_turtle
  • 1,243
  • 3
  • 17
  • 37
3

While setting proxy setting in eclipse you will get three proxy entries to be configured HTTP, HTTPS and SOCKS. Configure username and password in HTTP and HTTPS proxy entries, but not in SOCKS. Try this, it may help.

Also make sure the username and password you are typing is correct.

After configuration please restart eclipse, it is required for taking the effect of configuration.

SachinSarawgi
  • 2,632
  • 20
  • 28
1

download the plugin manually from here

https://dl.bintray.com/jetbrains/kotlin/eclipse-plugin/0.8.5/

(check if there is a latest version here)

https://dl.bintray.com/jetbrains/kotlin/eclipse-plugin

then

  1. create a directory called kotlin-plugin and copy the features and plugins directory (with all the downloaded jars in it) into it.
  2. close eclipse
  3. copy the kotlin-plugin directory into ${eclipse-install}/dropins
  4. start eclipse
Peter Szanto
  • 7,568
  • 2
  • 51
  • 53
0

Resolved by upgrading JVM (and the trusted certs ?)

Donatello
  • 3,486
  • 3
  • 32
  • 38
0

You may try this solution:

> sudo apt-get install ca-certificates-java
> sudo update-ca-certificates -f

add to eclipse.ini

-Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient4