![](/img/trans.png)
[英]configure Git to accept a particular self-signed server certificate for a particular https remote
[英]Git clone use gitlab self-signed CA throws error: requested domain name does not match the server's certificate
正如我已经知道一些人的建议,禁用 http.sslVerify是一个坏主意,根据一些帖子,最好的做法是将 gitlab 服务器 CA 添加到本地,所以我尝试了不同的方式:
git config --global http.sslCAInfo /home/yp/git-certs/rd.crt git clone https://10.xx.xx.xx/xxDepart/xxProject.git
GIT_SSL_CAINFO=/home/yp/git-certs/rd.crt git clone https://10.xx.xx.xx/xxDepart/xxProject.git
但两种方式都给我同样的错误:无法与对等方安全通信:请求的域名与服务器的证书不匹配。 我认为这可能是 gitlab 服务器问题或 CA 问题,而不是本地 git 配置错误。 有没有人遇到过这种问题,可以分享解决方案吗? 我使用的是CentOS7.6服务器,git版本是2.8
openssl x509 -text -noout -in cert.pem \
-certopt no_subject,no_header,no_version,no_serial,no_signame,no_validity,no_issuer,no_pubkey,no_sigdump,no_aux
如果它不包含您的 IP 地址,则该证书将被视为无效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.