[英]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.