coveralls-gradle-plugin icon indicating copy to clipboard operation
coveralls-gradle-plugin copied to clipboard

javax.net.ssl.SSLProtocolException with openjdk11 on Travis

Open Horcrux7 opened this issue 5 years ago • 11 comments

I receive a javax.net.ssl.SSLProtocolException: Connection reset by peer (Write failed) with Java 11 and also with Java 12-ea. It look like that Java 11 and newer can not communicate with your server. Here is the output from Gradle

> Task :coveralls FAILED
service name: travis-ci
service job id: 435042066
repo token: null
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':coveralls'.
> javax.net.ssl.SSLProtocolException: Connection reset by peer (Write failed)

see at https://travis-ci.org/i-net-software/jlessc/jobs/435042066

Any Idea how can solve this?

Horcrux7 avatar Sep 29 '18 18:09 Horcrux7

Disabling the TLS 1.3 protocol with:

-Djdk.tls.client.protocols="TLSv1,TLSv1.1,TLSv1.2"

solved the problem.

Horcrux7 avatar Sep 29 '18 19:09 Horcrux7

No luck with ./gradlew -Djdk.tls.client.protocols="TLSv1,TLSv1.1,TLSv1.2".

Also adding systemProp.jdk.tls.client.protocols="TLSv1,TLSv1.1,TLSv1.2" to gradle.properties didn't help.

Versions:

------------------------------------------------------------
Gradle 5.0
------------------------------------------------------------

Build time:   2018-11-26 11:48:43 UTC
Revision:     7fc6e5abf2fc5fe0824aec8a0f5462664dbcd987

Kotlin DSL:   1.0.4
Kotlin:       1.3.10
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM:          11 (Oracle Corporation 11+24-Ubuntu-118.04)
OS:           Linux 4.15.0-39-lowlatency amd64

lkrnac avatar Nov 29 '18 15:11 lkrnac

Yes, the hack does not work anymore. Today it is failing with Java 11 and Java 12.

Horcrux7 avatar Nov 29 '18 19:11 Horcrux7

I had a similar issue javax.net.ssl.SSLException: Received fatal alert: record_overflow but after adding systemProp.jdk.tls.client.protocols="TLSv1,TLSv1.1,TLSv1.2" to gradle.properties as @lkrnac said, the issue disappeared

I'm using OpenJDK-11, gradle 5, junit 5

apulbere avatar Jan 13 '19 22:01 apulbere

@kt3k Hi, are you willing to continue maintaining this project?

fzdy1914 avatar Mar 24 '19 09:03 fzdy1914

@fzdy1914 Actually I want to give this project to someone who can maintain. If you're willing to take over, you're welcome.

kt3k avatar Mar 24 '19 12:03 kt3k

Actually I want to give this project to someone who can maintain. If you're willing to take over, you're welcome.

I am willing to maintain it, but I am not sure how the grade plugin works and how to test it.

fzdy1914 avatar Mar 24 '19 13:03 fzdy1914

The underline problem of this issue is that ~the HTTPBuilder dependency used in the project is outdated and will throw an Exception when using TSL v1.3.~ a bug in JDK11's TLS v1.3 implementation causes it to send invalid data to coveralls.io [See here].

One workaround is to set the property of this plugin as below:

saveAsFile = true
sendToCoveralls = false

and add

after_success:
  - curl -F 'json_file=@build/coveralls/report.json' 'https://coveralls.io/api/v1/jobs'

to .travis.yml

fzdy1914 avatar Mar 24 '19 13:03 fzdy1914

Any version with a fix in sight for this issue? Had success with the gradle.properties workaround, but seems less than ideal.

Ondkloss avatar May 15 '19 12:05 Ondkloss

Always try to use openJDK with any of the jdk-stretch versions . It adjusts the compatibility accordingly .

Usha3012 avatar Aug 01 '19 15:08 Usha3012

Github Actions + Java 13 solved this

hurricup avatar Jul 08 '20 17:07 hurricup