Yocto - 解决Clone失败的问题

在Yocto的Project Quick Build文档里,使用的是下面命令clone仓库:(Yocto Project Quick Build — The Yocto Project ® 4.3.999 documentation)

$ git clone git://git.yoctoproject.org/poky

但可能由于环境原因或其他原因,一直显示连接失败,应该是git协议支持问题,要么服务器支持有问题,要么本地支持有问题。

Cloning into 'poky'...

fatal: unable to connect to git.yoctoproject.org:

git.yoctoproject.org[0: 198.145.29.87]: errno=Connection timed out

然后换成https:

git clone https://git.yoctoproject.org/poky

这样的话,在两台机器上,一台就可以,一台还是有问题。

Error信息:

server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

基本原因是您的电脑不信任签署 Git 服务器所用证书的证书颁发机构。这并不意味着证书可疑,但它可能是自签名的,或者是由不在操作系统 CA 列表中的机构/公司签名的。如果你没有任何理由对该证书产生怀疑,那么你要做的就是告诉电脑信任该证书,以规避电脑上的问题。

你需要检查用于 git服务器的网络证书,并将其添加到 </git_installation_folder>/bin/curl-ca-bundle.crt 中。

The basic reason is that your computer doesn't trust the certificate authority that signed the certificate used on the Git server. This doesn't mean the certificate is suspicious, but it could be self-signed or signed by an institution/company that isn't in the list of your OS's list of CAs. What you have to do to circumvent the problem on your computer is telling it to trust that certificate - if you don't have any reason to be suspicious about it.

You need to check the web certificate used for your git server, and add it to your </git_installation_folder>/bin/curl-ca-bundle.crt.

可以在不检查上述证书的情况下运行,可以设置:

export GIT_SSL_NO_VERIFY=1

#or

git config --global http.sslverify false

如果要添加证数,则运行下面命令:

hostname=XXX

port=443

trust_cert_file_location=`curl-config --ca`

sudo bash -c "echo -n | openssl s_client -showcerts -connect $hostname:$port -servername $hostname \

    2>/dev/null  | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'  \

    >> $trust_cert_file_location"

curl-config --ca 这个命令是用来识别curl-ca-bundle.crt这个文件的地址的,如果没有安装curl-config命令,则需要安装一下相关package。

port 443就是https服务。

我是直接运行git config --global http.sslverify false就可以clone代码了。

另外,有一种推荐是不使用Yocto网站的仓库,而是用github的:

GitHub - yoctoproject/poky: Mirror of https://git.yoctoproject.org/poky/.

参考:

1, StackOverflow

ubuntu - Unable to clone Yocto Poky - Stack Overflow

Server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none - Stack Overflow

  • 25
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夜流冰

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值