首页 > 解决方案 > 在 vagrant up 期间“无法获得本地颁发者证书”,即使在 vagrant box 添加 --insecure 之后

问题描述

我安装的 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

标签: bashvagrant

解决方案


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

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

    vagrant box add --insecure bento/ubuntu-16.04 --insecure
    
  2. 您可以box_download_insecure直接在 Vagrantfile 中添加标志

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

推荐阅读