The command failed, and the error was clear: TLS handshake aborted.
When Git connects over HTTPS, it relies on TLS (Transport Layer Security) to encrypt the session and verify trust. If TLS is misconfigured, you face clone failures, push errors, or security gaps. Correct Git TLS configuration ensures both secure transport and operational reliability.
Understanding Git TLS Configuration
Git itself doesn’t implement TLS directly. It delegates the work to the underlying HTTP client—often cURL—using the system’s SSL/TLS libraries. This means configuration depends on your OS and Git build, but key principles stay the same:
- Certificates: Git must trust the server’s certificate. You configure this with a trusted CA bundle.
- Protocols: Explicitly define allowed TLS versions to comply with security policies.
- Verification: Server identity checks must be enabled to prevent man-in-the-middle attacks.
Checking Current TLS Settings
Run:
git config --list --show-origin | grep http.ssl
Common keys:
http.sslVersionhttp.sslCAInfohttp.sslVerify
On a misconfigured system, http.sslVerify might be false—dangerous in production. Turn it back on with:
git config --global http.sslVerify true
Setting a Custom CA Certificate
If using an internal Git server with a private CA: