Peer not authenticated while importing Gradle project in eclipse

Change your repositories to the following in the build.gradle

repositories {
    maven  {
        url "http://repo1.maven.org/maven2"
    }
}

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"

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.