arteme / gradle-trust-all

A gradle plugin to disable SSL certificate validation
98 stars 27 forks source link

trust-all plugin not found #1

Open dvirguttman opened 8 years ago

dvirguttman commented 8 years ago

Hi,

I follow the instructions and gradle failed with "trust-all plugin not found" error

Any idea?

arteme commented 8 years ago

What version of gradle are you using? The project I use the plugin in is using quite an old version of gradle (2.2), so there might be a chance it is incompatible with newer versions. I'll check...

dvirguttman commented 8 years ago

With 2.8,2.11&2.12..

Currently with 2.12

Thanks

arteme commented 8 years ago

Works here with gradle 2.12:

 $ tree
.
├── build.gradle
├── gradle
│   ├── gradle-trust-all.jar
│   └── wrapper
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle

 $ cat build.gradle 
buildscript {
    dependencies {
        classpath files('gradle/gradle-trust-all.jar')
    }
}
apply plugin: 'trust-all'

 $ gradle 
:help

Welcome to Gradle 2.12.

To run a build, run gradle <task> ...

To see a list of available tasks, run gradle tasks

To see a list of command-line options, run gradle --help

To see more detail about a task, run gradle help --task <task>

BUILD SUCCESSFUL

Total time: 2.309 secs

This build could be faster, please consider using the Gradle Daemon: https://docs.gradle.org/2.12/userguide/gradle_daemon.html

If I remove "gradle-trust-all.jar" JAR file, then gradle complains.

Of course, if you reference the JAR from a subproject, you might want to make that path relative to the root project (files("$rootProject.projectDir/gradle/gradle-trust-all.jar")), but as far as I understand it, it should be enough to place the buildscript { ... } block in the root project build.gradle file, then apply plugin: 'trust-all' works for subprojects build.gradle files...

dvirguttman commented 8 years ago

OK, Now it it found.. But the library doesn't work :(...

Same error: FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 7.092 secs

arteme commented 8 years ago

Weird. Using jitpack.io shouldn't require trust-all plugin at all.

dvirguttman commented 8 years ago

Any idea?.... BTW, I'm working on Windows.

arteme commented 8 years ago

Even that shouldn't stop you. You may want to verify your default java keystore is okay using SSLPoke from https://confluence.atlassian.com/kb/unable-to-connect-to-ssl-services-due-to-pkix-path-building-failed-779355358.html like:

 $ java SSLPoke jitpack.io 443
Successfully connected

However, this problem may arise if you're using a custom keystore in your project. If you have something like this in your gradle.properties file:

systemProp.javax.net.ssl.trustStore=...
systemProp.javax.net.ssl.trustStorePassword=...

Then gradle will expect to be able to use that keystore to validate all SSL connections. Then that should be a copy of your default java keystore (such as c:\Program Files\Java\jre7\lib\security\cacerts) with all the extra certificates you need added using an appropriate tool (like keytool).

And indeed, in this situation I see the same error as you do, so we can assume the plug-in is indeed not working :( at least with new gradle versions. I'll need to debug this more.

dvirguttman commented 8 years ago

Hi,

Actually, when I run "java SSLPoke jitpack.io 443" in my windows I get this error..

Java was update today..

How can I add jitpack.io certificate.?

I tried it before..but seems it didn't success