Using gradle (gradlew) behind a proxy has been a nightmare so far. Gradle is unable to download anything via https (i,e, itself and any plugins).
Windows 10 - gradle 4.1
Connection timed out: connect
Exception in thread “main” javax.net.ssl.SSLHandshakeException: sun.security.val
idator.ValidatorException: PKIX path building failed: sun.security.provider.cert
path.SunCertPathBuilderException: unable to find valid certification path to req
But, even without a proxy we are having issues. It seems no matter what we do gradle ignores our settings.
We eventually fired up Fiddler on localhost port 8888 to try see what was happening but we cannot get gradle to use it.
What we’ve tried:
- Setting the following in gradle-wrapper.properties (and in User directory .gradle\gradle.properties
- Setting the following in gradlew.bat
set DEFAULT_JVM_OPTS=-Dhttp.proxyHost=localhost -Dhttp.proxyPort=8888
To no avail: gradle does not go via the Fiddler proxy and we’re very sure Fiddler is not the issue.
When we look at the URLs which gradle is trying to download - and getting SSL problems we have no problem downloading them in our browser and in firefox. So it’s unclear what the issue is.
set DEFAULT_JVM_OPTS=-Dcom.sun.net.ssl.checkRevocation=false -Dtrust_all_cert=true
Makes no difference at all to the errors.