在流浪期间“无法获得本地发行人证书”,即使在流浪框添加 --insecure 之后

yis*_*sky 4 bash vagrant

我安装的 Vagrant 版本是 2.2.3,我运行的是 Windows 8 的 6.3 版本。让我在下面复制我写到 git bash 中的内容以及结果是什么。

yishai and shira (master) vagrant $ vagrant box add --insecure bento/ubuntu-16.04 --insecure --force
==> box: Loading metadata for box 'bento/ubuntu-16.04'
    ...
==> box: Successfully added box 'bento/ubuntu-16.04' (v201812.27.0) for 'virtualbox'!
yishai and shira (master) vagrant $ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'bento/ubuntu-16.04' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: = 2.3.5
The box 'bento/ubuntu-16.04' 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/bento/ubuntu-16.04"]
Error: SSL certificate problem: unable to get local issuer certificate
Run Code Online (Sandbox Code Playgroud)

Fré*_*nri 10

您有 2 个解决方案来解决此问题:

  1. 您可以使用insecure标志下载该框

    vagrant box add --insecure bento/ubuntu-16.04 --insecure
    
    Run Code Online (Sandbox Code Playgroud)
  2. 您可以box_download_insecure直接在 Vagrantfile 中添加标志

    Vagrant.configure("2") do |config|
      config.vm.box = "bento/ubuntu-16.04"
      config.vm.box_download_insecure = true
    end
    
    Run Code Online (Sandbox Code Playgroud)