仕事で Windows7 でこつこつ作業する現役システムエンジニアです。
Java開発が多いんだけど たまのPHP開発では Vagrantを使った開発環境。
そのとき 原因不明で Vagrantが動作しないこともちょくちょく起きます・・・
今回も起きました。
ERROR: SSL verification error at depth 3: unable to get local issuer certificate
SSLエラ? さらに 同じVagrantfileをノートの Windows10 だと問題なく動作するという。
いろいろ苦戦して解決方法がすごくシンプルという結果に。備忘録をまとめました。
SSL verification error の現象
Vagrant のプラグイン ”sahara” をインストールしようとしました。
サンドボックスモードを有効にすることで ロールバックやコミットができる お馴染みのプラグインですね。
vagrant plugin install sahara
いつも通りインストールしようとしたら今回はエラーが・・・
ERROR: SSL verification error at depth 3: unable to get local issuer certificate (20)
ERROR: You must add /C=US/O=Starfield Technologies, Inc./OU=Starfield Class 2 C
ertification Authority to your local trusted store
Vagrant failed to load a configured plugin source. This can be caused
by a variety of issues including: transient connectivity issues, proxy
filtering rejecting access to a configured plugin source, or a configured
plugin source not responding correctly. Please review the error message
below to help resolve the issue:SSL_connect returned=1 errno=0 state=error: certificate verify failed (https:/
/gems.hashicorp.com/specs.4.8.gz)Source: https://gems.hashicorp.com/
そういや VirtualBox や Vagrant のバージョンアップしたし、さらに PowerShellも 2.0 から 5.1 にバージョンアップしたし 原因らしいことがいっぱい・・・
さて、どれが原因だ!
今までの定義情報をすべてクリアで解決
SSL関連かと思って 証明証について いろいろ試したけど解決せず。
確かに、”https://gems.hashicorp.com/” の証明証も変わったぽいけど。
結局、何をして直ったかといえば次のオプションをつけただけ。
--plugin-clean-sources
このオプションをつけて再度コマンドを叩くと
PS C:\hoge> vagrant plugin install sahara --plugin-clean-sources --plugin-source https://rubygems.org/ Installing the 'sahara' plugin. This can take a few minutes... Fetching: open4-1.3.4.gem (100%) Fetching: Platform-0.4.0.gem (100%) Fetching: popen4-0.1.2.gem (100%) Fetching: sahara-0.0.17.gem (100%) Installed the plugin 'sahara (0.0.17)'! PS C:\hoge>
できた!
トラブル起こったらキャッシュや設定の初期化をする。
初歩の初歩の解決方法でした。単純に環境が壊れてたんですね。これで何時間 潰したんだ・・・