michel-kraemer/gradle-download-task

SSLException: Connection Reset when migrating to 5.x

Closed this issue · 14 comments

Hi!
I was tasked with refining our Gradle script, including the download of a single zip file.
However, when upgrading the version of the plugin to 5.x version from 4.1.2 and making the necessary changes to the run method, the download keeps crashing due to an SSLException, specifically javax.net.ssl.SSLException: Connection reset.

The task in question:

task downloadBundle {
    download.run {
        src "${externalArtifactoryURL}/Bundle/${bundleVersion}/Bundle.zip"
        dest file(bundleLocation + '.zip')
        username artifactoryUserAccount
        password externalArtifactoryPassword
    }
}

We also have a backup server (no SSL) that works fine, but I still want to be able to download from this server.
Thanks in advance!

Does the server use a self-signed certificate? Have you tried using the acceptAnyCertificate flag?

I forgot to mention that. Yes I tried using that flag, but it also didn't work.
As for the self signed certificate, I am unsure. How can I find that out?

The subject and issuer don't match, if that's what you mean.

Well, what happens if you open the URL in your browser?

Downloading/accessing the server from the browser works just fine, as does downloading with an older version of the plugin.

Do you happen to know which SSL/TLS version your server uses?

It's using TLS 1.2

This should work actually 🤔 I don't know... It's very hard to tell what's going on without access to the server. I'm almost out of ideas.

Is there a proxy involved maybe? If so, can you try to configure Gradle to skip the proxy for this server? (see docs: https://github.com/michel-kraemer/gradle-download-task#proxy-configuration)

Thanks! I'll try that tomorrow and get back to you!

Alright, so proxy settings are not necessary, however, I came across this JFrog wiki article. Do you think that could be an issue with the newest plugin?

I'm not sure. As I said, without more information, it's really hard to debug this issue.

I created a small reproducer for you: issue211.zip

Please edit the Main.java file and change the host to your server. Then run ./gradlew run -s from the command line. It should create a download.log file. Send it to me via email. It will hopefully contain enough information to debug this issue. If possible, send me the full stacktrace of the exception you get too. Thanks!

Thank you for your time and effort on this issue. I've used the tool and looked at the output myself and contacted our DevOps team in order to check this out as I already have a sneaking suspicion that this is an issue on our end. I will definitely update this issue and send you the log if I get permission to do so.
Thanks again!

Sounds good. Looking forward to your feedback.

This issue has been automatically marked as stale because it has not had activity in the last 60 days. It will be closed in two weeks if no further activity occurs. Thank you for your contributions.

This issue has been automatically closed due to inactivity. If it is still valid, please post a comment.