Had the same problem hosting Go Git Server behind nginx and cloning:
remote: Enumerating objects: 103, done. remote: Counting objects: 100% (103/103), done. remote: Compressing objects: 100% (47/47), done. remote: Total 103 (delta 52), reused 99 (delta 51), pack-reused 0 Receiving objects: 100% (103/103), 11.56 KiB | 1.16 MiB/s, done. Resolving deltas: 100% (52/52), done. error: RPC failed; curl 56 GnuTLS recv error (-110): The TLS connection was non-properly terminated.
After searching RPC based issues, there appears to he a requirement to use HTTP2
Therefore this line in my nginx site configuration:
listen 443 ssl; # managed by Certbot
Was changed to this, to enable http2 - which is not a default:
listen 443 ssl http2; # managed by Certbot
And TLS in general seems happier (i.e. I had other errors regarding curl and TLS, when inspecting verbose output)
I have verified this as a root cause by removing http2, which reproduces the error and reinstating http2 resolves the problem.
export GIT_TRACE_PACKET=1; export GIT_TRACE=1; export GIT_CURL_VERBOSE=1
It probably has nothing to do with it, but it may be helpful to look in the verbose output so you can pinpoint the issue.