sourcetree更新代码SSL报错

在sourcetree里执行git clone 或者 git pull 的时候,提示SSL错误,大概的错误信息如下:

fatal: unable to access 'https://github.com/mfitzp/15-minute-apps.git/': error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version Completed with errors, see above.


stackoverflow上的答案大部分认为是git版本太古老。。。实测更新sourcetree后解决,从1.5.x更新到最新版本2.4.x。吐槽下最新的sourcetree其实没有老版本好用,速度太卡。

如果你用go get 获取github上的代码,可能会遇到同样的SSL错误,解决办法就是更新 git 客户端


I had the same problem and my fix was:
1.update git to the latest version
2.in command line check your tls version with command: git config http.sslVersion
3.if the version is tlsv1.0 than you have to update it to tlsv1.2 with command:

git config --global --unset http.sslVersion
git config --global --add http.sslVersion tlsv1.2

and than the error won't be present anymore


另外一个答案:
I had the same problem
First, update the git version from https://git-scm.com/downloads
You can install the 32 version and 64 version
Then try to pull the code from the remote repository.
If that doesn't work, run the following command to list all the git configurations

git config --global --list
Remove all the SSL configuration related settings. Remove only SSL configurations, like SSLVersion, etc. You can get the settings name from the above command result. The result format will be ConfigurationName=value. To remove configurations, run the following command.

git config --global --unset ConfigurationName
For example, if you want to remove the user.name configuration

git config --global --unset user.name
After deleting the SSL configurations, try to pull the code from the remote repository. This time the git will use the default SSL configuration values.

有话要说