配置Vagrant CA证书

Tea*_*tto 14 ruby ssl vagrant

我在公司代理服务器和自签名CA证书后面执行Vagrant命令时遇到问题.我已配置环境变量HTTP_PROXY,HTTPS_PROXY和HTTP_NO_PROXY变量.

我有一个包含所有公司证书的Java密钥库.我使用了keytool命令的-exportcert选项和许多选项.我已经使用了openssl命令以及许多选项,并将生成的文件放在Vagrant安装中的嵌入式Ruby目录中的多个位置,但没有任何成功.

我已经阅读了很多网站,其中包含有关配置Ruby和curl的信息,但在获取Vagrant命令方面没有任何成功.我找到的所有帖子都集中在Ruby和curl选项上,我不明白如何利用Vagrant,包括Ruby作为Vagrant的嵌入式组件.

请提供有关如何从Java密钥库正确导出证书的说明,并可选择转换它们并放置生成的文件,以便Vagrant能够成功地通过公司代理与Internet进行通信.

Windows 7上的Vagrant 1.9.5

Vagrant安装目录C:\ Apps\Vagrant \

C:\WorkArea> vagrant plugin install vagrant.proxyconf

ERROR:  SSL verification error at depth 3: self signed certificate in certificate chain (19)
ERROR:  Root certificate is not trusted (/C=US/O=xxx xxx/OU=xxx xxx Certification Authority/CN=xxx xxx Root Certification Authority 01 G2)  
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)

C:\WorkArea> vagrant up

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'puppetlabs/ubuntu-16.04-64-puppet' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
The box 'puppetlabs/ubuntu-16.04-64-puppet' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Atlas, 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://atlas.hashicorp.com/puppetlabs/ubuntu-16.04-64-puppet"]
Error: SSL certificate problem: self signed certificate in certificate chain
More details here: http://curl.haxx.se/docs/sslcerts.html
curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.
Run Code Online (Sandbox Code Playgroud)

ano*_*rmh 9

您没有解释为尝试解决问题所采取的步骤,但似乎您没有将根证书放在正确的位置.

转到安装Vagrant的目录,找到该文件embedded\cacert.pem,然后将公司证书的内容附加到该文件.保存并重试该操作.如果您正确导出了根CA证书,则应由Vagrant读取它们并允许连接.

如果您仍然无法使其通过结合文件的工作,尝试运行vagrantSSL_CERT_FILE=/path/to/your/certs.pem环境.这将允许您验证您是否已正确导出公司证书.

  • 这应该是问题的答案.关于如何导出证书的一些说明.在使用Internet Explorer的Windows中,您可以执行以下操作:"Internet选项">"内容选项卡">"证书"按钮>"受信任的根证书颁发机构"选项卡>选择您的证书>"导出"按钮>下一步>`Base-64编码X.509`>选择文件位置/名称>下一步>完成.右键单击该文件并在您选择的文本编辑器中打开并复制数据并粘贴到`embedded\cacert.pem`文件的末尾.在此之后我不得不通过控制台登录到vagrant然后`vagrant up`工作了. (4认同)