hechengQAQ

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
统计
 

一、使用git clone 克隆https://git.openstack.org/openstack-dev/devstack仓库时出错

问题描述:https协议克隆不受信任,然后换git协议,网络受限制(git.openstack.org[0: 104.130.253.131]: errno=Connection refused git.openstack.org[1: 2001:4800:7818:103:be76:4eff:fe01:f37d]: errno=Network is unreachable)

报错:fatal: unable to access 'https://git.openstack.org/openstack-dev/devstack/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none(服务器证书验证失败

解决:

这主要是因为系统不信任我的git服务器的凭证,所以无法通过系统的安全认证。我们找到了两种解决方案:

(一)跳过或关闭SSL证书检查。

(二)告诉系统该服务器是可信的。

(1):

export GIT_SSL_NO_VERIFY=1 添加环境变量,让git略过验证

(2):

git config --global http.sslVerify false 永久略过验证

(3)告诉系统服务可信

# 1.建立一个脚本:

touch import_ssl.sh

# 2.添加内容
hostname=my.git.com
port=port_num

# 取得自己 OS 中放置 CA 的位置
trust_cert_file_location=`curl-config --ca`

sudo bash -c "echo -n | openssl s_client -showcerts -connect $hostname:$port \
2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' \
>> $trust_cert_file_location"

# 3.执行脚本
$ bash import_ssl.sh

注意点:使用git协议记得生成SSH KEY GitHub添加KEY认证

 

持续更新中。。。。。。。。。。。。

 

posted on   hechengQAQ  阅读(67)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
 
点击右上角即可分享
微信分享提示