git 和“服务器中止 SSL 握手”错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36936678/
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 04:08:17  来源:igfitidea点击:

git and "Server aborted the SSL handshake" errors

gitsslgithubssh

提问by Benedikt S. Vogler

Often when I want to push to my private repo I get a "Server aborted the SSL handshake" error. After several tries it often suddenly works. I was yet not able to find a solution on the internet :(

通常,当我想推送到我的私人存储库时,我会收到“服务器中止 SSL 握手”错误。经过多次尝试,它经常突然起作用。我还没有在互联网上找到解决方案:(

If this weren't annoying enough today I wanted to install torch via git clone https://github.com/torch/distro.git ~/torch --recursive

如果今天这还不够烦人,我想通过以下方式安装手电筒 git clone https://github.com/torch/distro.git ~/torch --recursive

It fails every time at the public cutorch.git

每次在公共cutorch.git 上都失败

fatal: unable to access 'https://github.com/torch/cutorch.git/': Server aborted the SSL handshake fatal: clone of 'https://github.com/torch/cutorch.git' into submodule path 'extra/cutorch' failed

致命:无法访问“ https://github.com/torch/cutorch.git/”:服务器中止 SSL 握手 致命:将“ https://github.com/torch/cutorch.git”克隆到子模块路径中extra/cutorch' 失败

However when I execute this line by myself it works fine:

但是,当我自己执行这一行时,它工作正常:

git clone https://github.com/torch/cutorch.git/ extra/cutorch

Now I have to restart the install process wich fails because the folder already exists. So no torch for me unless this is fixed?

现在我必须重新启动安装过程,因为该文件夹已经存在。所以除非这是固定的,否则我没有手电筒?

I have the latest version of git(2.8.1) installed and use Mac OS 10.11.4.

我安装了最新版本的 git(2.8.1) 并使用 Mac OS 10.11.4。

How do I fix this annoying SSL handshake error?

如何解决这个烦人的 SSL 握手错误?

Update: It may be caused by my ISP. I have had phases where I had problems with HTTPS and iTunes Store connections as well.

更新:这可能是由我的 ISP 引起的。我也遇到过 HTTPS 和 iTunes Store 连接问题的阶段。

回答by CodeWizard

Often when I want to push to my private repo I get a "Server aborted the SSL handshake" error. After several tries it often suddenly works. I was yet not able to find a solution on the internet :(

通常,当我想推送到我的私人存储库时,我会收到“服务器中止 SSL 握手”错误。经过多次尝试,它经常突然起作用。我还没有在互联网上找到解决方案:(

It might be a problem of the different ssl version you are using.

这可能是您使用的不同 ssl 版本的问题。

In order to fix it generate a new ssl (RSA) certificate, and update your GitHub account with this new certificate.

为了修复它,请生成一个新的 ssl ( RSA) 证书,并使用此新证书更新您的 GitHub 帐户。

Here is how to set it up:

Here is how to set it up:

  • Generate a new ssh key. *Set the -t to rsain order to avoid future connection problems.

    ssh-keygen -t rsa
    
  • Once you have your generated in your %HOME%/.sshdirectory ( windows: Users/<your user>.ssh), open it and copy the content of the <keyname>.pub

  • 生成新的 ssh 密钥。*将 -t 设置为 rsa以避免将来出现连接问题。

    ssh-keygen -t rsa
    
  • %HOME%/.ssh目录 ( windows: Users/<your user>.ssh) 中生成后,打开它并复制内容<keyname>.pub



How to set up ssh key under your GitHub account?

How to set up ssh key under your GitHub account?

  • Login to GitHub account
  • Click on the rancher on the top right (Settings)
    enter image description here
  • Click on the SSH keys and GPG Keys
    enter image description here
  • Click on the New SSH key
    enter image description here
  • Paste your key and save
  • 登录GitHub账号
  • 点击右上角的牧场主 ( Settings)
    在此处输入图片说明
  • 点击 SSH keys and GPG Keys
    在此处输入图片说明
  • 点击 New SSH key
    在此处输入图片说明
  • 粘贴您的密钥并保存


Note

Note

After the first set up open terminal and run a git fetchso the key will be tested and added to your known hostsfile.

在第一次设置打开终端并运行之后git fetch,密钥将被测试并添加到您的known hosts文件中。

回答by korrekorre

Solved this by updating to latest version of MacOS (from Sierra to High Sierra). I guess that something outdated got updated and it started working directly. Maybe someone gets here today and experiences the same thing.

通过更新到最新版本的 MacOS(从 Sierra 到 High Sierra)解决了这个问题。我猜一些过时的东西得到了更新,它开始直接工作。也许今天有人来到这里并经历了同样的事情。

回答by Anandan Balasupramanian

I was having this issues while cloning the repo, was struggling for few days on this issue in MAC osx environment. I have also recently changed my account password.

我在克隆 repo 时遇到了这个问题,在 MAC osx 环境中的这个问题上挣扎了几天。我最近也更改了我的帐户密码。

Sharing the solution that worked for me:(comment all the proxies and un comment the required one alone)

分享对我有用的解决方案:(评论所有代理并单独取消评论所需的代理)

1) installed the SSH key as mentioned above.

1) 如上所述安装了 SSH 密钥。

2) open all the scripts having the proxy configuration in text pad and tiled them. 1).bash_profile, 2).gitconfig, 3) .npmrc 4).curlrc

2)在文本键盘中打开所有具有代理配置的脚本并将它们平铺。1).bash_profile, 2).gitconfig, 3) .npmrc 4).curlrc

3) comment all the proxy setting lines in all files by adding # in front

3) 通过在前面添加 # 来注释所有文件中的所有代理设置行

4)uncomment the one which is required - for me , i was doing a git clone from a secure server, hence i uncommented the [https] proxy line in .gitconfig file.

4)取消注释所需的 - 对我来说,我正在从安全服务器进行 git clone,因此我取消了 .gitconfig 文件中的 [https] 代理行的注释。

5) execute the clone command again, prompted for username and pass and clone was sucessful.

5)再次执行clone命令,提示输入username和pass,clone成功。

回答by RaviTezu

git clone https://github.com/torch/distro.git ~/torch --recursive

I have just tried cloning(using the above command) and it worked fine. I see all the submodules are hosted on github.com only. It might be some temporary issue with the SSL certificate at github.com's end.

我刚刚尝试过克隆(使用上述命令)并且效果很好。我看到所有子模块都仅托管在 github.com 上。这可能是 github.com 端的 SSL 证书的一些临时问题。

Or else, you can try cloning it via SSH if that works for you.

或者,如果适合您,您可以尝试通过 SSH 克隆它。

Sub-modules cloned:

克隆的子模块:

Submodule 'exe/env' (https://github.com/torch/env.git) registered for path 'exe/env'
Submodule 'exe/luajit-rocks' (https://github.com/torch/luajit-rocks.git) registered for path 'exe/luajit-rocks'
Submodule 'exe/qtlua' (https://github.com/torch/qtlua.git) registered for path 'exe/qtlua'
Submodule 'exe/trepl' (https://github.com/torch/trepl.git) registered for path 'exe/trepl'
Submodule 'extra/argcheck' (https://github.com/torch/argcheck.git) registered for path 'extra/argcheck'
Submodule 'extra/audio' (https://github.com/soumith/lua---audio.git) registered for path 'extra/audio'
Submodule 'extra/cudnn' (https://github.com/soumith/cudnn.torch.git) registered for path 'extra/cudnn'
Submodule 'extra/cunn' (https://github.com/torch/cunn.git) registered for path 'extra/cunn'
Submodule 'extra/cunnx' (https://github.com/nicholas-leonard/cunnx.git) registered for path 'extra/cunnx'
Submodule 'extra/cutorch' (https://github.com/torch/cutorch.git) registered for path 'extra/cutorch'
Submodule 'extra/fftw3' (https://github.com/soumith/fftw3-ffi.git) registered for path 'extra/fftw3'
Submodule 'extra/graph' (https://github.com/torch/graph) registered for path 'extra/graph'
Submodule 'extra/graphicsmagick' (https://github.com/clementfarabet/graphicsmagick.git) registered for path 'extra/graphicsmagick'
Submodule 'extra/lua-cjson' (https://github.com/mpx/lua-cjson) registered for path 'extra/lua-cjson'
Submodule 'extra/luaffifb' (https://github.com/facebook/luaffifb) registered for path 'extra/luaffifb'
Submodule 'extra/luafilesystem' (https://github.com/keplerproject/luafilesystem.git) registered for path 'extra/luafilesystem'
Submodule 'extra/nn' (https://github.com/torch/nn.git) registered for path 'extra/nn'
Submodule 'extra/nngraph' (https://github.com/torch/nngraph) registered for path 'extra/nngraph'
Submodule 'extra/nnx' (https://github.com/clementfarabet/lua---nnx.git) registered for path 'extra/nnx'
Submodule 'extra/penlight' (https://github.com/stevedonovan/Penlight.git) registered for path 'extra/penlight'
Submodule 'extra/sdl2' (https://github.com/torch/sdl2-ffi.git) registered for path 'extra/sdl2'
Submodule 'extra/signal' (https://github.com/soumith/torch-signal.git) registered for path 'extra/signal'
Submodule 'extra/threads' (https://github.com/torch/threads-ffi.git) registered for path 'extra/threads'
Submodule 'pkg/cwrap' (https://github.com/torch/cwrap.git) registered for path 'pkg/cwrap'
Submodule 'pkg/dok' (https://github.com/torch/dok.git) registered for path 'pkg/dok'
Submodule 'pkg/gnuplot' (https://github.com/torch/gnuplot.git) registered for path 'pkg/gnuplot'
Submodule 'pkg/image' (https://github.com/torch/image.git) registered for path 'pkg/image'
Submodule 'pkg/optim' (https://github.com/torch/optim.git) registered for path 'pkg/optim'
Submodule 'pkg/paths' (https://github.com/torch/paths.git) registered for path 'pkg/paths'
Submodule 'pkg/qttorch' (https://github.com/torch/qttorch.git) registered for path 'pkg/qttorch'
Submodule 'pkg/sundown' (https://github.com/torch/sundown-ffi.git) registered for path 'pkg/sundown'
Submodule 'pkg/sys' (https://github.com/torch/sys.git) registered for path 'pkg/sys'
Submodule 'pkg/torch' (https://github.com/torch/torch7.git) registered for path 'pkg/torch'
Submodule 'pkg/xlua' (https://github.com/torch/xlua.git) registered for path 'pkg/xlua'