boot-clj / boot

Build tooling for Clojure.
https://boot-clj.github.io/
Eclipse Public License 1.0
1.75k stars 179 forks source link

Boot 2.7.0+ incompatible with Java 7 #677

Closed martinklepsch closed 5 years ago

martinklepsch commented 6 years ago
$ java -version # java version "1.7.0_80"

$ BOOT_VERSION=2.7.0 boot -d clj-time

Could not transfer artifact boot:pod:pom:2.7.0 from/to clojars (https://repo.clojars.org/): Received fatal alert: protocol_version
[...]
Caused by: javax.net.ssl.SSLException: Received fatal alert: protocol_version
        at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
        at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
        at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1979)
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1086)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1332)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1359)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1343)
        at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:275)
        at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:254)
        at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:123)
        at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:318)
        at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363)
        at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219)
        at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
        at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)
        at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
        at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
        at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.execute(AbstractHttpClientWagon.java:832)
        at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:983)
        ... 9 more

This seems related: https://stackoverflow.com/questions/33595021/getting-javax-net-ssl-sslexception-received-fatal-alert-protocol-version-while

Not sure if this should be considered a Boot issue but the README states JDK 7+ are supported so I guess the options are dropping support and figuring out why this isn't working anymore.

martinklepsch commented 6 years ago

This works (via https://github.com/technomancy/leiningen/issues/2364):

env BOOT_VERSION=2.7.0 BOOT_JVM_OPTIONS=-Dhttps.protocols=TLSv1.2 boot -d clj-time
# also 2.6.0 just works fine, not sure why
env BOOT_VERSION=2.6.0 boot -d clj-time
tobias commented 6 years ago

The reason this appeared in boot 2.7.0 is we switched the default url that boot uses for clojars from https://clojars.org/repo (served by the clojars.org server) to https://repo.clojars.org (a CDN provided by Fastly). Unfortunately, Fastly only supports TLS 1.2. So another possible workaround until this is resolved is to use the old repo by overriding the url for clojars, which I think you can do with:

(set-env!
  :repositories  
         [["central" {:url "https://repo1.maven.org/maven2" :snapshots false}]
          ["clojars" {:url "https://clojars.org/repo"}]])
martinklepsch commented 6 years ago

One way to fix this could be to conditionally use the clojars.org server if we're on Java 7.

System.getProperty("java.version")
Deraen commented 6 years ago

What about just documenting that we require Java 8?

To provide some perspective, e.g. Boot-cljs and Compojure-api require Java 8.

martinklepsch commented 6 years ago

Yeah not fixing it definitely is an option and people who need Java 7 could still use the workaround of passing additional JVM OPTS. Hard to judge if there are many Boot users still on Java 7.

alandipert commented 5 years ago

I think we can say we require Java 8 now.