OSX系统Git拉取私有仓库代码失败求助:SSL协议版本错误
Hey Igor, I’ve run into this exact issue before with older Git versions on legacy OSX systems—let’s break down what’s happening and how to fix it.
Why this error happens
GitHub stopped supporting older TLS protocols (TLS 1.0/1.1) years ago, and your Git version 2.3.5 (released back in 2015) is too outdated to handle the newer TLS 1.2+ requirements GitHub now enforces. Your browser works because modern browsers automatically use up-to-date TLS versions, but old Git builds rely on outdated SSL libraries that can’t negotiate the right protocol with GitHub’s servers.
Solutions to try (ordered by reliability)
1. Upgrade Git to a version compatible with OSX 10.8 that supports TLS 1.2
OSX 10.8 is a legacy system, so the latest Git versions won’t run on it—but Git 2.17.x is the last release that officially supports OSX 10.8. Here’s what to do:
- Download the Git 2.17.x installer for OSX from the official Git archive (look for the
.dmgpackage labeled for OSX). - Run the installer, which will replace your old
/usr/local/git/bin/gitwith the updated version. - Verify the upgrade worked by running:
You should seegit --versiongit version 2.17.x(or a similar compatible release). After this, yourgit pullshould work normally over HTTPS.
2. Force Git to use TLS 1.2 (if upgrading isn’t an option)
If you can’t upgrade Git right now, try forcing it to use TLS 1.2 explicitly. Note that this only works if your system’s underlying SSL library supports TLS 1.2 (OSX 10.8’s OpenSSL might, but it’s hit-or-miss):
- Run this command to set the global Git config to use TLS 1.2:
git config --global http.sslVersion tlsv1.2 - Try pulling again:
git pull
If this doesn’t work, your Git version might not recognize the http.sslVersion setting—time to go with option 1 or 3.
3. Switch to SSH instead of HTTPS
Another workaround is to use SSH for repository access, which bypasses the HTTPS SSL protocol issue entirely:
- First, make sure you’ve set up an SSH key on your GitHub account (if you haven’t, generate one with
ssh-keygenand add the public key to your GitHub settings). - Update your remote repository URL to use SSH:
git remote set-url origin git@github.com:oneeyeman1/dbhandler.git - Now try pulling again—this should work without SSL errors as long as your SSH key is properly configured.
Final note
Upgrading Git is the most reliable long-term fix here, since older versions will keep running into compatibility issues with modern services like GitHub.
内容的提问来源于stack exchange,提问作者Igor

