git SourceTree 错误:1407742E:SSL 例程:SSL23_GET_SERVER_HELLO:tlsv1 警报协议版本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/48944875/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 05:14:38  来源:igfitidea点击:

SourceTree error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

gitgithubatlassian-sourcetree

提问by yu yang Jian

I'm using SourceTree and try to clone from a general github repository, but I got this error:

我正在使用 SourceTree 并尝试从通用 github 存储库进行克隆,但出现此错误:

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.

致命:无法访问“ https://github.com/mfitzp/15-minute-apps.git/”:错误:1407742E:SSL 例程:SSL23_GET_SERVER_HELLO:tlsv1 警报协议版本已完成但有错误,请参见上文。

How to solve it?

如何解决?

回答by yu yang Jian

Check Tools > Options > Gitin SourceTree, if you're using Use Embedded Git, you can see the git version is 1.9.5which is old, latest versionof git is 2.16.2.

检查Tools > Options > GitSourceTree,如果您正在使用Use Embedded Git,您可以看到 git 版本1.9.5是旧的,最新版本的 git 是2.16.2

So click Use System Git, if you install the newer version of git, after Use system Gitit'll show newer version, then try to clone again it should work fine.

所以点击Use System Git,如果你安装了较新版本的 git,在Use system Git它会显示较新版本之后,然后再次尝试克隆它应该可以正常工作。

Also see another answer HERE.

另请参阅此处的另一个答案。

enter image description here

在此处输入图片说明

回答by bsh

I had the same problem and my fix was:

我遇到了同样的问题,我的解决方法是:

1.update git to the latest version

1.更新git到最新版本

2.in command line check your tls version with command: git config http.sslVersion

2.在命令行中使用以下命令检查您的 tls 版本: git config http.sslVersion

3.if the version is tlsv1.0 than you have to update it to tlsv1.2 with command:

3.如果版本是 tlsv1.0,则必须使用以下命令将其更新为 tlsv1.2:

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

and than the error won't be present anymore

并且错误将不再存在

回答by Abed Alzain

You have to upgrade the git into the last version https://git-scm.com/downloads

您必须将 git 升级到最新版本 https://git-scm.com/downloads

回答by Shemeemsha R A

I had the same problem

我有同样的问题

First, update the git version from https://git-scm.com/downloads

首先,从https://git-scm.com/downloads更新 git 版本

You can install the 32 version and 64 version

可以安装32版本和64版本

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 配置

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.

删除所有与 SSL 配置相关的设置。仅删除 SSL 配置,如 SSLVersion 等。您可以从上述命令结果中获取设置名称。结果格式将为 ConfigurationName=value。要删除配置,请运行以下命令。

git config --global --unset ConfigurationName

For example, if you want to remove the user.name configuration

例如,如果要删除 user.name 配置

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.

删除 SSL 配置后,尝试从远程存储库中拉取代码。这次 git 将使用默认的 SSL 配置值。

回答by Thomas

I am using Mountain Lion (10.8.5) so I can't get a Git version higher than 2.3.5. The only thing that worked for me was to add an SSH key to my Github account, as explained here.

我正在使用 Mountain Lion (10.8.5),所以我无法获得高于 2.3.5 的 Git 版本。只对我来说有效的事情是SSH密钥添加到我的Github上的帐户,如解释在这里

And then cloning with SSH. Either use SourceTree or just git clone [email protected]:[username]/[repository].git

然后用 SSH 克隆。使用 SourceTree 或仅使用git clone [email protected]:[username]/[repository].git

回答by Ashish Mude

Download new version, it will work like a charm -

下载新版本,它会像魅力一样工作 -

https://git-scm.com/downloads

https://git-scm.com/downloads

回答by buddha

First I have installed git version 2.16. When I type the git version in the terminal, the output is 1.9. So I uninstalled the old version. And check the git version again, it show me 2.16. The issue resolved, The git works.

首先,我安装了 git 2.16 版。当我在终端中输入 git 版本时,输出为 1.9。所以我卸载了旧版本。并再次检查 git 版本,它显示了 2.16。问题解决了,git 工作了。

Also I have done the following step early, But I don't think this is effective.

我也很早就做了以下步骤,但我认为这不是有效的。

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