Peer not authenticated while importing Gradle project in eclipse

While I am importing gradle project in eclipse, it is giving me this error.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'test'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve de.richsource.gradle.plugins:gwt-gradle-plugin:0.3.
     Required by:
         :test:unspecified
      > Could not GET 'https://github.com/steffenschaefer/gwt-gradle-plugin/raw/maven-repo/de/richsource/gradle/plugins/gwt-gradle-plugin/0.3/gwt-gradle-plugin-0.3.pom'.
         > peer not authenticated

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

I am using internet via proxy connection. If that is the issue, where to specify the proxy settings inside eclipse. In General-->Network connections, proxy settings are already there

Please help.


Solution 1:

NOTE: Please ensure the server is trustworthy before you follow these steps.

If you get any other error like this:

 Could not GET 'https://some_server.com/some/path/some.pom'.
     > peer not authenticated

Then you need to import a certificate :

  • open the 'https://some_server.com/some/path/some.pom' in your favorite browser
  • export the cert using the Steps to export cert from a web site
  • copy the cer into JDK_HOME/jre/lib/security folder
  • open a shell and go to JDK_HOME/jre/lib/security folder
  • then import the cer into java using the
keytool -import -alias <the short name of the server> -file <cert_file_name_you_exported.cer> -keystore cacerts -storepass changeit

It will prompt you to import the certificate, type yes and press enter.

Then restart your eclipse and try building the project.

Solution 2:

ANSWER#2:Providing the correct fix after two Negative markings

Make this changes to the top-level build.gradle file.

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        //jcenter()
        jcenter {
            url "http://jcenter.bintray.com/"  <=THIS IS THE LINE THAT MAKES THE DIFFERENCE
        }
    }
}

allprojects {
    repositories {
        //jcenter()
        jcenter {
            url "http://jcenter.bintray.com/" <=THIS IS THE LINE THAT MAKES THE DIFFERENCE
        }
    }
}

ANSWER#1 (Although this is not accepted would like to keep this)

If you see "peer not authenticated errors , it does not necessarily mean that the application does not hold a valid certificate. It also could mean that connections are being reset by the firewall, load balancer, or web servers. Try (re)starting the application with the Administator privilege.

On Windows:

  • Ensure you have administrator privileges.
  • Right Click application icon -> Select "Run as Administrator"

On Linux:

  • Ensure you have root access.
  • type sudo "app execution script name"