0

i want to enable Rest API for our gerrit tigger jenkins plugin.

So whenever i give the http username/password in the rest api enablement section of the gerrit tigger plugin. i get the following exception

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

The password i took is from our gerrit installation's -> settings-> http password UI. I am not aware of the internal of our git/gerrit server installation and its configurations

my ssh connection for normal git+gerrit operations works fine.

Probably i am missing something very simple.

EDIT Jenkins version : 2.7

Gerrit version : 2.12.2-49-g70b6923

Gerrit trigger plugin: 2.20.0

Regards,

Saurav

saurav
  • 5,388
  • 10
  • 56
  • 101

1 Answers1

0

This error occurs when Java code try to connect through https using ssl certificate which is not listed in cacerts file of jre.

Solution

Step 1

Locate which JRE is responsible for this error.This is most important and but easy task!

Step 2

Open that HTTPS URL in CHROME BROWSER which gives this error most probably you have problem with https url of Gerrit server!

Step 3

-> After page load click on Lock like symbol located just left side of your url.Click on it.

-> Click on details

-> Click on view certificate.

-> select TOP MOST CERTIFICATE in hierarchy and Drag and drop certificate image to desktop.

NOW YOU GOT CERTIFICATE.

Step 3

Detailed GUIDE how to install the certificate at cacerts file of jre is THIS link

NOTE: Please post problem with details

Community
  • 1
  • 1
positivecrux
  • 1,307
  • 2
  • 16
  • 35
  • Yes you are right...seems to be that my Jenkins JVM does not have the certificate with which gerrit is configured in its trust store – saurav Jun 09 '16 at 06:41
  • Jenkins by default uses the jre which located under the jre sub-directory of your jenkins installation home ( %JENKINS_HOME ). change cacerts there update us all. – positivecrux Jun 09 '16 at 10:10