Getting "sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target" when trying to establish a connectivity between Jira and Jenkins

I am getting below issue when I am trying to establish a connection from Jira to Jenkins using Atlassian Jira Software Cloud plugin by creating a webhook at Jira end. Any suggestion on this issue is highly appreciated.

Jenkins version - 2.401.3
Java version - openjdk 11.0.20 2023-07-18
Atlassian Jira Software Cloud plugin Version - 2.0.9

Please note that Jenkins server is hosted behind a firewall.

sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:146)
at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:127)
at java.base/java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297)
at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:434)

Hello @pratimamaitijenkins and welcome to this community. :wave:

The error message you’re encountering, “unable to find valid certification path to requested target,” seems to indicate that the Java application (in this case, Jenkins) is unable to establish a secure SSL/TLS connection because it doesn’t trust the certificate authority (CA) that issued the SSL certificate presented by the target server (in this case, your Jira server).

To resolve this issue, I think you will need to ensure that Jenkins trusts the SSL certificate presented by your Jira server.

You may want to have a look at this article: BMC Community .

Maybe you can try this, here is a sample: Jenkins connects with SonarQube

##### docker
# if your jenkins in container whose name is "jenkins", do this:
docker exec jenkins sh -c "echo | openssl s_client -connect sonar.m.local:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /var/tmp/sonarqube.crt"

# delete it if existed
docker exec jenkins sh -c "keytool -delete -alias sonarqube -cacerts -storepass changeit"

# import it with "-noprompt"
docker exec jenkins sh -c "keytool -import -alias sonarqube -file /var/tmp/sonarqube.crt -cacerts -storepass changeit -noprompt"

Hi @poddingue and @pplmx , Thank you for your responses. It is resolved. There was a certificate issue as mentioned by @poddingue

Hi @pratimamaitijenkins ,

Thanks a lot for your feedback.

I just registered this community to say thanks for your reply.
Thanks a lot bro.
It is solved my problem.

1 Like