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 ‘https://gitlab.com/api/v4/projects/24119727/packages/maven/lib_demo/lib/unspecified/lib-unspecified.jar’.
Received fatal alert: handshake_failure

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

Anyone got the same issue?