vagrant plugin install でSSL verifyエラー
こちらの掲示板を参考にして解決したのでメモしておきます。
実行環境
Windows10 pro
VirtualBox5.1.6
Vagrant 1.8.7
背景
cmdでvagrant plugin installすると数秒後下記エラーで止まる。
vagrant plugin install vagrant-hostsupdater
Installing the 'vagrant-hostsupdater' plugin. This can take a few minutes...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:
Could not verify the SSL certificate for https://rubygems.org/.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
Warning: this Gemfile contains multiple primary sources. Using `source` more than once without a block is a security risk, and may result in installing unexpected gems. To resolve this warning, use a block to indicate which gems should come from the secondary source. To upgrade this warning to an error, run `bundle config disable_multisource true`.
vagrant plugin installにオプションつけたりしたけど変化なし。
最終的に解決した方法
C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.8.5\plugins\commands\plugin\command
mixin_install_opts.rbファイルを編集する。
module VagrantPlugins
module CommandPlugin
module Command
module MixinInstallOpts
def build_install_opts(o, options)
options[:plugin_sources] = [
"http://rubygems.org",
"http://gems.hashicorp.com",
]
https -> http
正規の方法ではないかもしれないけど、plugin installはできたのでよかったです。