【问题标题】:git and "Server aborted the SSL handshake" errorsgit 和“服务器中止 SSL 握手”错误
【发布时间】:2016-04-29 11:04:30
【问题描述】:

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

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

每次公开都失败cutorch.git

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

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

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

现在我必须重新启动失败的安装过程,因为该文件夹已经存在。所以除非解决这个问题,否则我没有手电筒?

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

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

更新:可能是我的 ISP 造成的。我也遇到过 HTTPS 和 iTunes Store 连接出现问题的阶段。

【问题讨论】:

  • 对我来说这是一个暂时的问题。大约 2 分钟后,我再次尝试推动,效果很好。 OP 可能并非如此,但对于一些来这里查找此错误消息的人来说,值得一试。
  • 对我来说,我需要做的就是重启我的 Mac。显然一些缓存弄脏了作品。

标签: git ssl github ssh


【解决方案1】:

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

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

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

Here is how to set it up:

  • 生成一个新的 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?

  • 登录 GitHub 帐户
  • 点击右上角的牧场主 (Settings)
  • 点击SSH keys and GPG Keys
  • 点击New SSH key
  • 粘贴您的密钥并保存

Note

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

【讨论】:

  • 不错的指南,但是在 git fetch 上:“服务器中止 SSL 握手”
  • 我修改了很多,今天成功了。也许这不是解决方案,但它仍然有助于标记为已接受的答案。也许在 github 的最后有一些问题。
  • 设置ssh key后,需要从https切换到ssh help.github.com/articles/changing-a-remote-s-url
  • 我在 bitbucket repo 上执行命令 git fetch upstream 时遇到此错误。但正如你提到的,第二次尝试它神奇地工作而没有做任何事情。
【解决方案2】:

【讨论】:

    【解决方案3】:
    git clone https://github.com/torch/distro.git ~/torch --recursive
    

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

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

    克隆的子模块:

    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'
    

    【讨论】:

    • 适合你,但不适合我。这就是我寻求帮助的原因:) 我不认为这是一个暂时的问题,因为我的推送问题是几个月来的问题。用 ssh 替换 https 给我“权限被拒绝(公钥)。致命:无法从远程存储库读取。”
    • 你试过git clone git@github.com:torch/distro.git --recursive 吗?
    • 按照其他成员的建议,您需要将 SSH 公钥添加到您的 github.com 帐户并重试。
    • 嗨,你也可以试试这个吗? 1. 登录您的 Github 帐户 2. 转到设置 -> SSH 和 GPG 密钥 3. 删除旧的或未使用的密钥。
    • 另外,我看到 github.com 面临一些问题:status.github.com/messages
    【解决方案4】:

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

    【讨论】:

      【解决方案5】:

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

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

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

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

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

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

      5) 再次执行克隆命令,提示输入用户名并通过,克隆成功。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2017-01-27
        • 1970-01-01
        • 2016-03-02
        • 2016-10-31
        • 2017-02-11
        • 1970-01-01
        • 1970-01-01
        • 2012-09-03
        相关资源
        最近更新 更多