简体   繁体   English

Git LFS 给出 x509:证书由未知机构签名

[英]Git LFS give x509: certificate signed by unknown authority

I have just setup an Ubuntu 18.04 LTS Server with Gitlab following the instructions from https://about.gitlab.com/install/#ubuntu . I have just setup an Ubuntu 18.04 LTS Server with Gitlab following the instructions from https://about.gitlab.com/install/#ubuntu .

I have issued a ssl certificate from GoDaddy and confirmed this works with the Gitlab server.我已经从 GoDaddy 颁发了 ssl 证书,并确认这适用于 Gitlab 服务器。

I have then updated gitlab.rb: gitlab_rails['lfs_enabled'] = true然后我更新了 gitlab.rb: gitlab_rails['lfs_enabled'] = true

I have installed GIT LFS Client from https://git-lfs.github.com/ .我已经从https://git-lfs.github.com/安装了 GIT LFS 客户端。

I have then tried to find a solution online on why I do not get LFS to work.然后我试图在网上找到一个解决方案,说明为什么我没有让 LFS 工作。 I always get我总是得到

x509: certificate signed by unknown authority x509: 由未知机构签署的证书

Other settings done in gitlab.rb :gitlab.rb中完成的其他设置:

gitlab_workhorse[‘env’] = {
‘SSL_CERT_DIR’ => ‘/opt/gitlab/embedded/ssl/certs/’
}
nginx[‘redirect_http_to_https’] = true

I am not an expert on Linux/Unix/git - but have used Unix/Linux for some 30+ years and git for a number of years - not just setup git with LFS myself before.我不是 Linux/Unix/git 方面的专家——但我使用 Unix/Linux 已经有 30 多年了,使用 git 也有很多年了——不仅仅是我之前用 LFS 设置了 git。

I just had that same issue while running git clone ... to download source code from a private Git repository in BitBucket into a Docker image.我在运行git clone ...时遇到了同样的问题git clone ...将源代码从 BitBucket 中的私有 Git 存储库下载到 Docker 映像中。 I solved it by disabling the SSL check like so:我通过禁用 SSL 检查来解决它,如下所示:

GIT_SSL_NO_VERIFY=1 git clone ...

Notice that there is no && between the Environment arg and the git clone command.请注意, Environment arg 和 git clone 命令之间没有&&

You can also set that option using git config :您还可以使用git config设置该选项:

git config http.sslverify false

For my use case in building a Docker image it is easier to set the Env var.对于我构建 Docker 镜像的用例,设置环境变量更容易。

The problem is that Git LFS finds certificates differently than the rest of Git.问题是 Git LFS 找到的证书与 Git 的 rest 不同。

It might need some help to find the correct certificate.可能需要一些帮助才能找到正确的证书。

I and my users solved this by pointing http.sslCAInfo to the correct location.我和我的用户通过将 http.sslCAInfo 指向正确的位置来解决这个问题。

git config http.sslCAInfo ~/.ssh/id_ed25519 where id_ed25519 is the users private key for the problematic repo so change as appropriate. git config http.sslCAInfo ~/.ssh/id_ed25519其中 id_ed25519 是有问题的存储库的用户私钥,因此请酌情更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在企业环境中使用x509证书签署git commit - Sign git commit with x509 certificate in corporate environment git-lfs给出“错误:“ git-lfs”的未知命令“ post-merge””? - git-lfs gives “Error: unknown command “post-merge” for “git-lfs””? 无法使用Git LFS检出文件:“ git-lfs”的未知命令“ post-checkout” - Cannot checkout a file with Git LFS: `unknown command “post-checkout” for “git-lfs”` git lfs migrate import --no-rewrite 未知标志 --no-rewrite - git lfs migrate import --no-rewrite unknown flag --no-rewrite 添加自签名SSL证书而不禁用授权签名证书 - Adding self-signed SSL certificate without disabling authority-signed ones Git - “SSL证书问题:证书链中的自签名证书” - Git - “SSL certificate issue: self signed certificate in certificate chain” Eclipse Git自签名证书错误 - Eclipse Git self signed certificate error sonarqube - 添加自签名证书以与 git 连接 - sonarqube - adding self signed certificate to connect with git 与Jenkins的GIT失败,错误为“证书链中的自签名证书” - GIT with Jenkins failed with error “self signed certificate in certificate chain” “git lfs install”是否包含在“git lfs migrate”中? - Is "git lfs install" included in "git lfs migrate"?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM