Cause: Unable to find valid certification path to requested target

I have following script in my gradle.build file:
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath ‘com.github.jengelman.gradle.plugins:shadow:1.2.3’
}
}

apply plugin: 'java’
apply plugin: ‘com.github.johnrengelman.shadow’

I am working behind proxy
I have provided proxy host,port,username,password in gradle vm options in intellij idea editor as well as I have provided the same details in gradle.properties file located at project root folder.
Then I imported the certificate for shadow.jar from site:
https://jcenter.bintray.com/com/github/jengelman/gradle/plugins/shadow/1/2/3

Then I added this certificate in certficate-store cacerts located at %java_home%/jre/lib/security

Even then it is not working and giving me certificate issue while resolving the dependency specified in classpath in gradle.build file

1 Like

I have the same problem on Windows10, I also added the corresponding certificate in certficate-store cacerts located at %java_home%/jre/lib/security ,but it doesn’t work !
my java version is 1.9 and my maven version is 5.6.2

do you have found a resolution for this issue ? I think it is related to the company’s network restrictions.

PKIX path building failed

Usually means that either your Java installation is “broken”, missing the according trusted root certificates, or that on that URL something is answering with a non-valid HTTPS certificate, either due to a man-in-the-middle attack, or due to some Proxy in the network showing you some information that is not coming from the original URL.

Enabling --info or --debug could help get further information on what is actually returned from the URL.
Or you can add -Djavax.net.debug=all to your Gradle commandline so that the HTTPS communication details are logged. You might want to pipe this to a file as it will produce large output. It will for example show which certificates are sent by the server and so on and should help investigating this.

Often - especially if you can open the URL in your browser - this means that you need to use some proxy to access the outworld from your network, but you did not configure Gradle to use that proxy..