首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >流浪汉不能在windows上工作

流浪汉不能在windows上工作
EN

Stack Overflow用户
提问于 2015-10-05 04:22:59
回答 4查看 12.2K关注 0票数 16

我正在关注https://docs.vagrantup.com/v2/getting-started/index.html上的官方流浪文档

我已经在Windows10 64位处理器上安装了vagrant和virtual box。在命令提示符上运行这些命令后,我得到:

代码语言:javascript
复制
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)选项。

如何修复此错误?

EN

回答 4

Stack Overflow用户

发布于 2015-10-05 04:40:09

如果遇到SSL问题,可以尝试使用--insecure选项添加计算机

代码语言:javascript
复制
vagrant box add --insecure hashicorp/precise32 hashicorp/precise32

:不安全当存在时,如果URL是HTTPS URL,则不会验证SSL证书

如果您有一些未完成的传输,您可能需要清理~/.vagrant.d/tmp/文件夹

您还可以下载ssl证书并直接使用它绕过错误

代码语言:javascript
复制
$ vagrant box add --cacert <certificate> box_name
票数 17
EN

Stack Overflow用户

发布于 2017-04-21 04:12:50

您可以将其添加到Vagrantfile中

代码语言:javascript
复制
config.vm.box_download_insecure=true
票数 14
EN

Stack Overflow用户

发布于 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似乎是新的设置。

手动方式:

代码语言:javascript
复制
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.
票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32937994

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档