SSL certificate problem: unable to get local issuer certificate

windows命令窗口 vagrant up 启动vagrant出错

C:\Users\Administrator>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'centos/7' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
The box 'centos/7' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Vagrant Cloud, please verify you're logged in via
`vagrant login`. Also, please double-check the name. The expanded
URL and error message are shown below:

URL: ["https://vagrantcloud.com/centos/7"]
Error: SSL certificate problem: unable to get local issuer certificate


我测试了一下你那报错的地址https://vagrantcloud.com/centos/7
会调到https://app.vagrantup.com/centos/boxes/7
如果这样跳转的话,肯定提示你找不到。。。
而且,网站里也有说明:

img

这样的话,是要换个方式部署了?或者修改好对应的配置

望采纳。
这个通常是由于 Vagrant 无法验证远程服务器的 SSL 证书导致的。具体来说,Vagrant 在访问远程服务器时会尝试验证服务器的 SSL 证书,如果无法验证证书,就会出现这个错误。

要解决这个问题,可以尝试以下几种方法:

1、检查网络连接是否正常。如果你的网络连接不稳定,可能会导致 Vagrant 无法访问远程服务器。
2、更新 Vagrant 和 VirtualBox 的版本,并确保用的是最新版本。有时,使用旧版本的 Vagrant 或 VirtualBox 可能会导致这个错误。
3、使用 vagrant box update 命令更新虚拟机镜像。
4、尝试使用不同的网络环境(例如,切换到其他的 WiFi 或使用移动数据连接)。有时,网络环境可能会影响 Vagrant 的访问远程服务器的能力。
5、尝试使用 vagrant up --debug 命令来获取更多的调试信息。这会帮助更好地了解问题的根本原因。
6、如果用的是 Windows 系统,可以尝试使用 Git Bash 或其他类似的命令行工具来运行 Vagrant 命令,因为有时 Windows 自带的命令行工具会出现问题。
如果以上方法都无法解决问题,可以在 Vagrant 官网或社区论坛上寻找更多的解决方案。

这个错误可能是由于你所使用的 Vagrant 版本过旧或者网络连接问题导致的。

首先,你可以尝试更新 Vagrant 到最新版本,然后再尝试启动虚拟机。

如果更新 Vagrant 依然无法解决问题,你可以尝试使用替代的 box 文件。可以在 Vagrant Cloud 或者其他网站上下载 box 文件,然后使用vagrant box add命令将其添加到本地。

另外,你也可以尝试检查你的网络连接是否正常,或者尝试使用代理解决 SSL 证书问题。

希望这些建议能帮到你。如果问题依然存在,你可以尝试在 Vagrant 的官方论坛或者其他在线社区寻求帮助。

可参考该实际思路,看是否解决你的问题:http://t.csdn.cn/gTuaz

望采纳!!!点击该回答右侧的“采纳”按钮即可采纳!!!
我猜可能是 Vagrant 无法从远程服务器获取到有效的 SSL 证书,导致无法正常连接并下载虚拟机镜像。

可能的解决方法包括:

1.检查当前网络连接是否正常,是否能够访问 Vagrant Cloud 服务器。
2.尝试使用代理连接到 Vagrant Cloud 服务器,可以使用 'vagrant up --http-proxy=http://proxy-server:port' 命令启动虚拟机。
3.尝试在终端中执行 'vagrant login' 命令,确保已经正确登录了 Vagrant Cloud。
4.尝试更新本地 SSL 证书库,或者安装证书颁发机构的根证书。


如果以上方法均无法解决问题,可以尝试在终端中执行 'vagrant box remove centos/7'
命令删除本地虚拟机镜像,然后再次使用 'vagrant up' 命令尝试启动虚拟机。


有两种方式:
2-1) 检查你安装的证书路径
看下跟你 curl 中使用的是否一致

2-2curl 取消 ssl 检查
如果你没有证书,
可以在 curl 相关代码中添加下面的代码

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

这个错误信息表明,Vagrant 在尝试使用 virtualbox provider 启动虚拟机时,无法找到名为 centos/7 的虚拟机镜像(也就是 box)。

要解决这个问题,有以下几种可能的解决方案:

检查输入的 box 名称是否正确。可以使用 vagrant box list 命令查看当前已安装的 box 列表,确保输入的 box 名称正确。

确保您已经正确地登录了 Vagrant Cloud。如果您在使用私有 box,那么在尝试使用 vagrant up 命令之前,需要先使用 vagrant login 命令登录 Vagrant Cloud。

确保网络连接正常。如果 Vagrant 无法访问 Vagrant Cloud,那么就会出现这个错误。可以尝试使用其他软件访问 Vagrant Cloud 网站,确保网络连接正常。

如果以上方法都无法解决问题,那么可以尝试使用其他的 provider,例如 VMware 或者 Hyper-V。可以使用 vagrant up --provider=vmware_desktop 或者 vagrant up --provider=hyperv 命令来启动虚拟机。

如果还是无法解决问题,建议您尝试卸载 Vagrant 并重新安装,或者查看 Vagrant 官网上的常见问题解答,看看是否有其他的解决方案。

可以尝试配置 git 忽略 ssl 认证再重新执行命令

git config --global http.sslVerify "false"

提示:相同问题的朋友更新vagrant版本可解决此问题