error: RPC failed; curl 56 GnuTLS recv error (-110): The TLS connection was non-properly terminated.

Note: This solution is not just limited to codecommit but also for other Ubuntu gnults_handshake related issues.
If you have AWS cli installed in ubuntu 14.04 and working with AWS codecommit, you are likely to get “gnutls_handshake() failed” error when you try to clone a repository created in codecommit. Do not worry about it, we have a solution for it.

问题似乎是 Ubuntu gnutls_handshake 的问题。

解决方案重新编译 git

使用 libcurl-openssl-dev 去替换 gnutls

  • 安装必要的依赖及环境
    sudo apt-get install build-essential fakeroot dpkg-dev
  • 建个目录放 新编译的 git
    mkdir ~/git-rectify
  • 获取 git 源码
    cd ~/git-rectify
    sudo apt-get source git
  • 安装 git 的依赖
    sudo apt-get build-dep git
  • 安装 libcurl
    sudo apt-get install libcurl4-openssl-dev
  • 进入 git 目录,这里目录名视你安装的版本
    cd git-2.7.4/
  • 修改两个文件后重新编译 git
    vim ./debian/control # 把libcurl4-gnutls-dev 修改为 libcurl4-openssl-dev
    vim ./debian/rules # 把TEST=test整行删除
    sudo dpkg-buildpackage -rfakeroot -b
  • 回到上一级目录,安装编译好的安装包
    cd .. # 也就是在 ~/git-rectify 目录下
    sudo dpkg -i git_2.7.4-0ubuntu0.4_amd64.deb

源码安装 git

这里只是记录一下源码安装 git 的步骤。
git clone https://github.com/git/git.git
切换到相应的版本 tag
git checkout -b v2.22.0
sudo apt-get install libssl-dev
根据 doc 文档 说明的安装命令安装即可。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值