Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to download plugin for eclipse

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?

like image 816
magic_turtle Avatar asked Nov 18 '16 00:11

magic_turtle


People also ask

How do I fix Pkix path building failed in Eclipse?

Solution : You can solve this (PKIX) problem like this. Note: You may follow below step for exporting and importing certificates from Web Browser to cacerts. Click On "More Info" > "Security" > "Show Certificate" > "Details" > "Export" > "Copy to File".

How do I download Google Plugin for Eclipse?

To install the plugin: Drag the install button into your running Eclipse workspace: Or from inside Eclipse, select Help > Eclipse Marketplace... and search for Google Cloud Tools for Eclipse. Restart Eclipse when prompted.


1 Answers

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".

like image 118
Peter Avatar answered Sep 17 '22 05:09

Peter