本文翻译自:server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

I can push by clone project using ssh, but it doesn't work when I clone project with https. 我可以使用ssh推送克隆项目,但是当我使用https克隆项目时,它不起作用。

The error message that shows me is: 显示我的错误消息是:

server certificate verification failed. CAfile: /etc/ssl/certs/cacertificates.crt CRLfile: none

#1楼

参考:https://stackoom.com/question/1qScL/服务器证书验证失败-CAfile-etc-ssl-certs-ca-certificates-crt-CRLfile-无


#2楼

TLDR: TLDR:

hostname=XXX
port=443
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"

Long answer 长答案

The basic reason is that your computer doesn't trust the certificate authority that signed the certificate used on the Gitlab server . 根本原因是您的计算机不信任对Gitlab服务器上使用证书进行签名的证书颁发机构 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. 这并不意味着证书可疑,但是它可以是自签名的,也可以由不在您的操作系统的CA列表中的机构/公司签名。 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 gitLab server, and add it to your </git_installation_folder>/bin/curl-ca-bundle.crt . 您需要检查用于gitLab服务器的Web证书,并将其添加到</git_installation_folder>/bin/curl-ca-bundle.crt

To check if at least the clone works without checking said certificate, you can set: 要检查至少克隆是否可以正常工作而不检查所述证书,可以设置:

export GIT_SSL_NO_VERIFY=1
#or
git config --global http.sslverify false

But that would be for testing only, as illustrated in " SSL works with browser, wget, and curl, but fails with git ", or in this blog post . 但这仅用于测试,如“ SSL可与浏览器,wget和curl配合使用,但对git失败 ”所示,或在本博客文章中说明 。

Check your GitLab settings, a in issue 4272 . 检查您的GitLab设置( 问题4272) 。


To get that certificate (that you would need to add to your curl-ca-bundle.crt file), type a: 要获取该证书(您需要将其添加到curl-ca-bundle.crt文件中),请键入:

echo -n | openssl s_client -showcerts -connect yourserver.com:YourHttpGilabPort \2>/dev/null  | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'

(with ' yourserver.com ' being your GitLab server name) (以“ yourserver.com ”为您的GitLab服务器名称)

To check the CA (Certificate Authority issuer), type a: 要检查CA(证书颁发机构颁发者),请键入:

echo -n | openssl s_client -showcerts -connect yourserver.com:YourHttpGilabPort \2>/dev/null  | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' \| openssl x509 -noout -text | grep "CA Issuers" | head -1

Note: Valeriy Katkov suggests in the comments to add -servername option to the openssl command, otherwise the command isn't showed certificate for www.github.com in Valeriy's case. 注意: Valeriy Katkov建议在注释中为-servername命令添加-servername选项,否则在Valeriy的情况下,该命令不会显示www.github.com的证书。

 openssl s_client -showcerts -servername www.github.com -connect www.github.com:443 

Findekano adds in the comments : Findekano添加了评论 :

to identify the location of curl-ca-bundle.crt , you could use the command 要确定curl-ca-bundle.crt的位置,可以使用以下命令

curl-config --ca

Also, see my more recent answer " github: server certificate verification failed ": you might have to renistall those certificates: 另外,请参阅我最近的答案“ github:服务器证书验证失败 ”:您可能必须放弃所有这些证书:

sudo apt-get install --reinstall ca-certificates
sudo mkdir /usr/local/share/ca-certificates/cacert.org
sudo wget -P /usr/local/share/ca-certificates/cacert.org http://www.cacert.org/certs/root.crt http://www.cacert.org/certs/class3.crt
sudo update-ca-certificates
git config --global http.sslCAinfo /etc/ssl/certs/ca-certificates.crt

#3楼

Note: This has major security implications. 注意:这具有重大的安全隐患。

Open your terminal and run following command: 打开终端并运行以下命令:

export GIT_SSL_NO_VERIFY=1

It works for me and I am using Linux system. 它对我有用,我正在使用Linux系统。


#4楼

Another cause of this problem might be that your clock might be off. 造成此问题的另一个原因可能是您的时钟关闭了。 Certificates are time sensitive. 证书是时间敏感的。

To check the current system time: 要检查当前系统时间:

date -R

You might consider installing NTP to automatically sync the system time with trusted internet timeservers from the global NTP pool . 您可能会考虑安装NTP,以自动将系统时间与全局NTP池中的受信任的Internet时间服务器同步。 For example, to install on Debian/Ubuntu: 例如,要在Debian / Ubuntu上安装:

apt-get install ntp

#5楼

GIT_CURL_VERBOSE=1 git [clone|fetch]…

should tell you where the problem is. 应该告诉您问题出在哪里。 In my case it was due to cURL not supporting PEM certificates when built against NSS, due to that support not being mainline in NSS ( #726116 #804215 #402712 and more ). 在我的情况下,它是由于卷曲时对NSS内置不支持PEM证书,由于NSS的支持不是主线( #726116 #804215 #402712 和 更多 )。


#6楼

Had same problem. 有同样的问题。 Caused by self issued certificate authority. 由自我颁发的证书颁发机构引起。 Solved it by adding .pem file to /usr/local/share/ca-certificates/ and calling 通过将.pem文件添加到/ usr / local / share / ca-certificates /并解决

sudo update-ca-certificates

PS: pem file in folder ./share/ca-certificates MUST have extension .crt PS:文件夹./share/ca-certificates中的pem文件必须具有扩展名.crt

服务器证书验证失败。 CAfile:/etc/ssl/certs/ca-certificates.crt CRLfile:无相关推荐

  1. 服务器证书验证失败怎么办

    手机或是电脑在日常生活中使用是非常频繁的,一些人会拿自己个人信息绑定手机或者电脑上,一些人害怕出现信息泄漏的问题,手机可以使用密码保护自己的信息资料,电脑也可以加密自己的信息,只要在电脑上安装服务器就 ...

  2. 报税时提示服务器验证证书失败,服务器证书验证失败 服务器证书验证地址出错怎么办...

    手机或是电脑在日常生活中使用是非常频繁的,一些人会拿自己个人信息绑定手机或者电脑上,一些人害怕出现信息泄漏的问题,手机可以使用密码保护自己的信息资料,电脑也可以加密自己的信息,只要在电脑上安装服务器就 ...

  3. linux curl证书错误,curl服务器证书验证失败

    我有一堆使用curl与各种服务进行通信的PHP脚本.目前,这些服务的SSL证书之一已更新,当我尝试从服务器的CLI获取该证书时,我的弯腰就开始哭了: ~$ curl https://example.c ...

  4. python ssl连接 证书验证失败_即使在添加CA证书之后,Python也会请求SSL证书验证失败...

    我一直在使用Python Requests库来刮取网站一段时间,但该网站最近更改了SSL证书,新的证书将无法验证请求 . 根据类似问题的答案,我已将请求和urllib3更新到最新版本(2.4.3和1. ...

  5. 江西银行手机银行服务器证书验证失败,江西银行网上银行登录常见问题

    江西银行的字号代表的意思就是江西省,是一块各方势力都乐于采用的招牌,在民国时期的时候,江西银行在经营时间以及经营规模上面都仅仅次于江西裕民银行,江西银行的复杂性又要高于省内的其他银行,再加上江西银行两 ...

  6. 手机服务器证书验证失败怎么回事,安卓手机连接websocket证书校验失败已解决

    问题已解决 - 当前 Bug 的表现(可附上截图) 旧安卓机发起websocket连接出错 - 预期表现 正常连上websocket - 复现路径 猜歌王小程序首页进入排位赛,点击任意一场排位赛即可复 ...

  7. 手机工行显示服务器,工行手机银行服务器安全证书验证失败

    工行手机银行服务器安全证书验证失败 内容精选 换一换 华为云帮助中心为用户提供云产品文档,解决公有云用户常见问题,包括云服务器ECS,云数据库RDS,云存储OBS,负载均衡等服务的使用指南,API及S ...

  8. python ssl连接 证书验证失败_python foursquare – SSL3证书验证失败

    我正在尝试使用Mike Lewis的 Python包装器( https://github.com/mLewisLogic/foursquare)向Foursquare API发出无用的请求: clie ...

  9. ssl证书验证失败打不开网页

    现在说到证书方面的知识,大家一点都不陌生,反倒是有很多人比较熟悉,但是关于ssl证书验证失败打不开网页这个问题如何去处理,ssl证书下载又是怎么样的一个过程?大家很多都是不理解的.其实这个问题都是基础 ...

最新文章

  1. ArcGis License 启动失败
  2. itextpdf中文不显示_LaTeX实时预览中文
  3. php语言与jsp,关于开发语言之PHP JSP与ASP NET对比浅析
  4. DCMTK:读取多个图像的示例应用程序
  5. SAP CRM Cross Component级别的跳转如果出了问题,该如何调试
  6. 久等了,「阿里妈妈技术」来啦!
  7. python对浏览器的常用操作_selenium+python基本操作(02)
  8. 新手手册:Pytorch分布式训练
  9. 商品详情页html,天天生鲜商品详情页HTML+css
  10. 雨林木风win11 64位安全旗舰版镜像V2021.09
  11. python画折线图-python如何画折线图
  12. 2019年工程造价表_【行业要闻】中国建设工程造价管理协会 关于2019年工程造价咨询企业造价咨询收入排名的公告...
  13. redhat6安装git出现的问题
  14. 毕设题目:Matlab电力负荷预测
  15. 获取浏览器地址栏字符串参数
  16. 以赛促产 以赛引才 |第六届世界智能大会·中国华录杯数据湖算法大赛正式启动
  17. 解决CSDN上传MD文件不能显示照片
  18. 知识表示的方法(3)——状态空间表示法
  19. 计算机审计终结与报告,审计个人总结范文
  20. 企业网盘应用,加速上海交大信息化校园建设

热门文章

  1. [英语语法]句法之省略句型
  2. 如何在M1 Mac上运行iOS应用?
  3. 安装win2008r2、域控、IIS、证书服务器、部署exchange2010
  4. 判断括号匹配的程序java_java判断左右括号匹配
  5. 多租户实现之基于Mybatis、Mycat的共享数据库,共享数据架构
  6. mfc编程 孙鑫_孙鑫MFC学习笔记6:菜单编程
  7. [Java8]_[语言特性]_[Lambda表达式说明]
  8. 如何实现产销平衡_做好生产计划和控制的核心步骤(8)产销协同
  9. 东北大学计算机专业(专业硕士)研究生入学考试2009真题
  10. 【数据结构】大连理工大学软件学院20年