title: Pulling gradle distributionUrl through artifactory remote-simple repository results in javax.net.ssl.SSLHandshakeException
body: <p>How can I tell gradle wrapper to trust my artifactory's cert without modifying every machine that uses it or am I pulling through artifactory in the wrong way?</p>
  
  <p>My artifactory uses a self signed cert and my systems are set to trust this.  Within a gradle build, access to the artifactory repos works wonderfully for my dependencies but gradlew less so.</p>
  
  <p>To improve build reliability, we added an artifactory simple remote repository for <strong><a href="https://services.gradle.org/distributions/gradle-" rel="nofollow noreferrer">https://services.gradle.org/distributions/gradle-</a>...</strong> but see the following when we build:</p>
  
  <p><strong>gradle-wrapper.properties</strong></p>
  
  <pre><code>distributionUrl=https\://artifactory01.megacorp.us/remote-simple-artifactory/distributions/gradle-4.0.2-all.zip
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <pre><code>Exception in thread "main" javax.net.ssl.SSLHandshakeException:
  sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: 
  unable to find valid certification path to requested target
  </code></pre>
  
  <p>It sure looks like gradlew is treating artifactory as a man-in-the-middle (which in essence it is).</p>
  
  <p>What's the right way to do this?</p>