Received fatal alert: handshake_failure when publish to maven package registry

I was trying to publish a package into maven package.

With gradle, I hit an error when I have gradle daemon enabled.

* What went wrong:

Execution failed for task ‘:lib:publishLibraryPublicationToMavenRepository’.

Failed to publish publication ‘library’ to repository ‘maven’
Could not write to resource ‘’.
Received fatal alert: handshake_failure

As long as I disable the daemon, it works fine.

Anyone got the same issue?

I have exactly the same issue. Disabled the daemon and it was working.

Problem is solved after updating java 11 to version 11.0.10.