title: Gradle Can't Download Plugins From HTTPS Through Proxy
body: <p>I've been trying to get gradle to download a plugin, which is coming from an HTTPS URL, and can't for the life of my figure out what I'm doing wrong.  From what I've read on the internet, this is usually solved by setting a proxy - which I have, and from the debug logs gradle appears to be using it.  I've also tried manually adding the certificates that are listed for all of the URLs in the debug log to my cacerts file to no avail.</p>
  
  <p>The debug log - from the last redirect performed by gradle for the springboot plugin - is shown below:</p>
  
  <pre><code>Redirecting to 'https://jcenter.bintray.com/org/springframework/boot/spring-boot-tools/1.4.3.RELEASE/spring-boot-tools-1.4.3.RELEASE.pom' via {tls}-&gt;http://myProxy:2020-&gt;https://jcenter.bintray.com:443
  can be kept alive indefinitely
  Connection released: [id: 204][route: {tls}-&gt;http://myProxy:2020-&gt;https://plugins.gradle.org:443][total kept alive: 2; route allocated: 1 of 2; total allocated: 2 of 20]
  CookieSpec selected: default
  Auth cache not set in the context
  Connection request: [route: {tls}-&gt;http://myProxy:2020-&gt;https://jcenter.bintray.com:443][total kept alive: 2; route allocated: 0 of 2; total allocated: 2 of 20]
  Connection leased: [id: 206][route: {tls}-&gt;http://myProxy:2020-&gt;https://jcenter.bintray.com:443][total kept alive: 2; route allocated: 1 of 2; total allocated: 3 of 20]
  Opening connection {tls}-&gt;http://myProxy:2020-&gt;https://jcenter.bintray.com:443
  Connecting to myProxy/myProxyIp:2020
  Connection established myIp:64916&lt;-&gt;myProxyIp:2020
  Tunnel to target created.
  Enabled protocols: [TLSv1, TLSv1.1, TLSv1.2]
  Enabled cipher suites:[Removed for readability]
  Starting handshake
  http-outgoing-206: Shutdown connection
  Connection discarded
  http-outgoing-206: Close connection
  Connection released: [id: 206][route: {tls}-&gt;http://myProxy:2020-&gt;https://jcenter.bintray.com:443][total kept alive: 2; route allocated: 0 of 2; total allocated: 2 of 20]
  Flushing resolved configuration data in Binary store in C:\Temp\gradle7433380394459999850.bin. Wrote root 2.
  Timing: Running the build script took 1.082 secs
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  A problem occurred configuring root project 'TutorialHelloWorld'.
  &gt; Could not resolve all dependencies for configuration ':classpath'.
     &gt; Could not resolve org.springframework.boot:spring-boot-gradle-plugin:1.4.3.RELEASE.
       Required by:
           project :
        &gt; Could not resolve org.springframework.boot:spring-boot-gradle-plugin:1.4.3.RELEASE.
           &gt; Could not parse POM https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-gradle-plugin/1.4.3.RELEASE/spring-boot-gradle-plugin-1.4.3.RELEASE.pom
              &gt; Could not resolve org.springframework.boot:spring-boot-tools:1.4.3.RELEASE.
                 &gt; Could not resolve org.springframework.boot:spring-boot-tools:1.4.3.RELEASE.
                    &gt; Could not get resource 'https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-tools/1.4.3.RELEASE/spring-boot-tools-1.4.3.RELEASE.pom'.
                       &gt; Could not GET 'https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-tools/1.4.3.RELEASE/spring-boot-tools-1.4.3.RELEASE.pom'.
                          &gt; sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
  
  * Try:
  Run with --stacktrace option to get the stack trace. 
  
  BUILD FAILED
  </code></pre>
  
  <p>I can download this file through my browser, which also uses the proxy so that should be OK.  This is with Java 1.8.0_71-b15 and gradle 3.4.</p>
  
  <p>I also tried the same command from the same machine on a network with no proxy (and no proxy configured for gradle) and ended up with the same error, so it seems like this is something with my environment rather than the proxy.</p>
  
  <p>Any ideas what could be going on here?</p>