我正在关注https://docs.vagrantup.com/v2/getting-started/index.html上的官方流浪文档
我已经在Windows10 64位处理器上安装了vagrant和virtual box。在命令提示符上运行这些命令后,我得到:
vagrant init hashicorp/precise32
vagrant up错误如下所示:正在使用'virtualbox‘提供程序启动计算机'default’...==>默认值:找不到‘hashicorp/recise32’框。正在尝试查找和安装...default: Box Provider: virtualbox default: Box Version:>= 0在远程编录中找不到或无法访问框‘hashicorp/recise32’。如果这是HashiCorp的地图集上的私人邮箱,请确认你是通过vagrant login登录的。另外,请仔细检查一下名字。展开的URL和错误消息如下所示:
http://curl.haxx.se/docs/sslcerts.html:[“SSL”]错误:SSL证书问题:无法在此处获取本地颁发者证书详细信息:URL
默认情况下,curl使用一组证书颁发机构(CA)公钥(CA证书)执行SSL证书验证。如果缺省包文件不够用,可以使用--cacert选项指定一个替代文件。如果此HTTPS服务器使用由捆绑包中代表的CA签名的证书,则证书验证可能由于证书问题而失败(该证书可能已过期,或者名称可能与URL中的域名不匹配)。如果您想关闭curl对证书的验证,请使用-k (或-k)选项。
如何修复此错误?
发布于 2015-10-05 04:40:09
如果遇到SSL问题,可以尝试使用--insecure选项添加计算机
vagrant box add --insecure hashicorp/precise32 hashicorp/precise32:不安全当存在时,如果URL是HTTPS URL,则不会验证SSL证书
如果您有一些未完成的传输,您可能需要清理~/.vagrant.d/tmp/文件夹
您还可以下载ssl证书并直接使用它绕过错误
$ vagrant box add --cacert <certificate> box_name发布于 2017-04-21 04:12:50
您可以将其添加到Vagrantfile中
config.vm.box_download_insecure=true发布于 2017-02-14 01:10:53
由于长期禁用SSL验证是一种可怕的做法,您可以通过将证书添加到嵌入式Ruby和curl的信任链(痛苦但可以自动化,http://guides.rubygems.org/ssl-certificate-update/#manual-solution-to-ssl-issue),或者更好地使用添加到较新的Vagrant版本中的备用CA路径来纠正证书颁发。config.vm.box_download_ca_cert似乎是新的设置。
手动方式:
The steps are as follows:
Step 1: Obtain the correct trust certificate
Step 2: Locate RubyGems certificate directory in your installation
Step 3: Copy correct trust certificate
Step 4: Profit
Step 1: Obtain the correct trust certificate
We need to download the correct trust certificate, YourCompanyRootCA.pem.
This can probably be obtained from your IT department or by exporting the certificate from your web browser or certificate store (and possibly converting to .pem using OpenSSL).
IMPORTANT: File must have .pem as extension. Browsers like Chrome will try to save it as plain text file. Ensure you change the filename to end with .pem after you have downloaded it.
Step 2: Locate Ruby certificate directory in your installation
In order for us copy this file, we need to know where to put it.
Depending on where you installed Ruby (or Vagrant has embedded it), the directory will be different.
Take for example the default installation of Ruby 2.1.5, placed in C:\Ruby21
Or the Vagrant default of C:\HashiCorp\Vagrant\embedded (or /opt on Linux)
Search for `cacert.pem` or any `*.pem` in those directories.
Step 3: Copy new trust certificate
Now, locate ssl_certs directory (Ruby) and copy the .pem file we obtained from previous step inside.
It will be listed with other files like AddTrustExternalCARoot.pem.
If you are updating the Vagrant cacert.pem, make a backup copy, then append the entire contents of your new .pem file to the end of the cacert.pem. This should eliminate the warnings from Vagrant's ruby/curl.https://stackoverflow.com/questions/32937994
复制相似问题