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
的问题。
使用 libcurl-openssl-dev 去替换 gnutls
sudo apt-get install build-essential fakeroot dpkg-dev
mkdir ~/git-rectify
cd ~/git-rectify
sudo apt-get source git
sudo apt-get build-dep git
sudo apt-get install libcurl4-openssl-dev
cd git-2.7.4/
vim ./debian/control
# 把libcurl4-gnutls-dev 修改为 libcurl4-openssl-devvim ./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 clone https://github.com/git/git.git
切换到相应的版本 tag
git checkout -b v2.22.0
sudo apt-get install libssl-dev
根据 doc 文档 说明的安装命令安装即可。