git显示unable to get local issuer certificate
时间: 2023-11-09 20:59:35 浏览: 69
这个问题通常出现在使用 HTTPS 协议进行 Git 操作时,你可以尝试以下解决方法:
1. 更新 Git 版本到最新;
2. 在 Git Bash 中执行以下命令:
```
git config --global http.sslVerify false
```
3. 手动导入缺失的证书。
如果以上方法都无法解决问题,你可以尝试使用 SSH 协议进行 Git 操作。
相关问题
git clone unable to get local issuer certificate
The error message "unable to get local issuer certificate" usually occurs when Git is unable to verify the SSL certificate of the remote repository. This issue can be resolved by configuring Git to trust the SSL certificate or by disabling SSL verification. Here's how you can resolve this issue:
1. Configure Git to trust the SSL certificate:
- Download the SSL certificate for the remote repository. You can typically do this by opening the repository URL in a web browser and exporting the SSL certificate.
- Save the SSL certificate file to your local machine.
- Open a terminal or command prompt and navigate to the Git repository you want to clone.
- Run the following command, replacing `<path/to/certificate.crt>` with the path to the downloaded SSL certificate:
```
git config http.sslCAInfo <path/to/certificate.crt>
```
- Try cloning the repository again.
2. Disable SSL verification (not recommended):
- Open a terminal or command prompt and navigate to the Git repository you want to clone.
- Run the following command:
```
git config http.sslVerify false
```
- Try cloning the repository again.
Please note that disabling SSL verification is not recommended as it compromises the security of your connection. It's better to configure Git to trust the SSL certificate if possible.
git下载github操作 unable to get local issuer certificate
当在使用git下载github操作时出现"unable to get local issuer certificate"的错误,这通常表示git无法验证github的SSL证书,因为缺少本地颁发机构(CA)的根证书。有几种方法可以解决这个问题。
方法一是手动添加缺失的根证书。你可以从颁发机构的网站或其他可靠来源下载所需的根证书,并将其添加到git的证书存储中。具体步骤如下:
1. 打开https://github.com,点击浏览器的锁图标,查看证书详情。
2. 导出根证书(Root Certificate)到本地,保存为.pem或.crt格式的文件。
3. 在命令行中运行以下命令,将根证书添加到git的证书存储中:
git config --global http.sslCAinfo /path/to/root_certificate.pem
(将/path/to/root_certificate.pem替换为你保存根证书的路径)
方法二是禁用SSL证书验证。请注意,这种方法会降低连接的安全性,建议尽量使用方法一来解决问题。如果你仍然想要禁用SSL证书验证,请按照以下步骤操作:
1. 在命令行中运行以下命令,禁用SSL证书验证:
git config --global http.sslVerify false
无论你选择哪种方法,都应该能够解决"unable to get local issuer certificate"的问题并成功下载github操作。
阅读全文