# \[Solved\] SSL Errors when calling gradlew

**URL:** <https://discuss.gradle.org/t/solved-ssl-errors-when-calling-gradlew/14806>\
**Category:** Help/Discuss\
**Created:** [February 28, 2016, 7:29am UTC](https://discuss.gradle.org/t/solved-ssl-errors-when-calling-gradlew/14806 "2016-02-28T07:29:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrewp](https://avatars.discourse-cdn.com/v4/letter/a/df788c/32.png) [@andrewp](https://discuss.gradle.org/u/andrewp)\
**Post date:** [February 28, 2016, 7:29am UTC](https://discuss.gradle.org/t/solved-ssl-errors-when-calling-gradlew/14806/1 "2016-02-28T07:29:10Z")

</div>

Not sure exactly what else might be needed for this kind of thread, so if you want more config info just let me know. This is on a Mac, El Capitan. There’s no proxy set up that I can tell, but I am on a VPN.

```
$ ./gradlew idea
Downloading https://services.gradle.org/distributions/gradle-2.3-all.zip

Exception in thread "main" java.lang.RuntimeException: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:44)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:126)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:58)
Caused by: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at sun.security.ssl.InputRecord.handleUnknownRecord(InputRecord.java:710)
at sun.security.ssl.InputRecord.read(InputRecord.java:527)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1513)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
at org.gradle.wrapper.Download.downloadInternal(Download.java:56)
at org.gradle.wrapper.Download.download(Download.java:42)
at org.gradle.wrapper.Install$1.call(Install.java:57)
at org.gradle.wrapper.Install$1.call(Install.java:44)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
... 3 more

```

I’ve tried downloading the file in question and linking the `gradle` file from its bin folder, running `set _JAVA_OPTIONS = -Dcom.sun.net.ssl.checkRevocation=false`, putting the same line into gradle.properties, and disabling all proxies, firewall, and VPN connections. I can download the file through browsers just fine.

I’m not even really sure why it’s trying to download gradle again, since there’s a copy in the project folder.

Any and all help is greatly appreciated.

---

<div class="post-metadata">

**Author:** ![andrewp](https://avatars.discourse-cdn.com/v4/letter/a/df788c/32.png) [@andrewp](https://discuss.gradle.org/u/andrewp)\
**Post date:** [March 30, 2016, 9:06pm UTC](https://discuss.gradle.org/t/solved-ssl-errors-when-calling-gradlew/14806/2 "2016-03-30T21:06:25Z")

</div>

I’m still having this issue, now with SSL connections to [repo1.maven.org](http://repo1.maven.org) - in addition, trying to use [InstallCert](https://github.com/escline/InstallCert) yields the following:

```
me$ java InstallCert repo1.maven.org:443
Loading KeyStore /Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/jre/lib/security/cacerts...
Opening connection to repo1.maven.org:443...
Starting SSL handshake...

javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
	at sun.security.ssl.InputRecord.handleUnknownRecord(InputRecord.java:710)
	at sun.security.ssl.InputRecord.read(InputRecord.java:527)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
	at InstallCert.main(InstallCert.java:98)
Could not obtain server certificate chain

```

What is going on here? What am I missing?

---

<div class="post-metadata">

**Author:** ![andrewp](https://avatars.discourse-cdn.com/v4/letter/a/df788c/32.png) [@andrewp](https://discuss.gradle.org/u/andrewp)\
**Post date:** [March 31, 2016, 3:12am UTC](https://discuss.gradle.org/t/solved-ssl-errors-when-calling-gradlew/14806/3 "2016-03-31T03:12:00Z")

</div>

Solved. The issue was that the version of gradle that I was using doesn’t support https, but the .properties file referred to mavenCentral(), which by default yields an https connection.
