javaeclipseeclipse-plugincertificatepkix

How do I connect to an update site in Eclipse when I get an "Unable to read repository" ProvisionException error?


When trying to connect to an update site in eclipse in order to install the Cucumber-Eclipse plugin, I'm getting the following error:

Unable to read repository at http://cucumber.io/cucumber-eclipse/update-site/content.xml.
    Unable to read repository at http://cucumber.io/cucumber-eclipse/update-site/content.xml.
    sun.security.validator.ValidatorException: PKIX path building failed: 
   sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested
   target

Solution

  • The issue in this case was at first misleading as all other answers with the SunCertPathBuilderException relate to missing certificates in the java cacerts file.

    Here it was actually caused by a URL redirection. The Cucumber-Eclipse website lists the update site for their plugin as:

    https://cucumber.io/cucumber-eclipse/update-site

    However, when navigating to that URL in a browser, it redirects to:

    http://cucumber.github.io/cucumber-eclipse/update-site/

    Note the added ".github".

    Resolution

    If experiencing this issue for an Eclipse plugin, navigate to the update site URL in a browser and copy the URL from there after the page has loaded. This should give you the true update site URL, which can then be added as an Available Site in Eclipse.