更新GitHub及TortoiseGit后仍遇SSL协议版本错误求助
error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version in CMD Git Push What's Going On Here?
That SSL error pops up because the Git client your CMD is using is trying to connect with an outdated TLS/SSL protocol version (like TLS 1.0 or 1.1) that GitHub no longer supports.
TortoiseGit works (despite the warning) because it usually bundles its own modern SSL library, so it can fallback to a supported protocol even if there's a minor version mismatch warning. Your CMD's Git instance, though, is relying on an older SSL setup—even if you updated GitHub Desktop or TortoiseGit, the Git executable in your system PATH might still be outdated.
Step-by-Step Fixes
First, check your CMD Git version
Run this in CMD to confirm which Git you're using:git --versionIf the version is anything older than Git 2.14.1 (when TLS 1.2 support became default), that's the root problem.
Update the Git executable used by CMD
- Option 1: Install the latest standalone Git for Windows. During installation, make sure to select "Use the OpenSSL library" and ensure the Git installation path is added to your system
PATH(the installer usually does this by default). - Option 2: If you use GitHub Desktop, it includes a modern Git copy. Find its path (usually
C:\Users\<YourUsername>\AppData\Local\GitHubDesktop\app-<VersionNumber>\resources\app\git\cmd), then add this path to the top of your systemPATH(so CMD picks this Git first instead of any older versions).
- Option 1: Install the latest standalone Git for Windows. During installation, make sure to select "Use the OpenSSL library" and ensure the Git installation path is added to your system
Force Git to use TLS 1.2 globally
Run these commands in CMD to enforce modern TLS:git config --global http.sslVersion tlsv1.2 git config --global https.sslVersion tlsv1.2If you had any old proxy settings that might interfere, clear them too:
git config --global --unset http.proxy git config --global --unset https.proxyVerify your settings
Check that the TLS config is applied:git config --global --get http.sslVersion git config --global --get https.sslVersionBoth should return
tlsv1.2. Now try pushing your code again—this should resolve the SSL error.
Why TortoiseGit Worked (With the Warning)
TortoiseGit doesn't rely on the system-wide Git or SSL libraries by default. It comes with its own bundled tools, so even if your system has outdated SSL components, TortoiseGit can negotiate a supported TLS version (hence the "unsupported ssl version" warning is just a minor mismatch notice, not a showstopper).
内容的提问来源于stack exchange,提问作者Robert

