ブラックボックス

プログラミングのノウハウやライフハックをどんどん投稿していきたい

Dec 5, 2017 - 1 minute read - ノウハウ

【Vagrant】Error: SSL certificate problemが発生する

様々なOSに対応させる為、Vagrant上にDockerを乗せようとしていますが、PCによって動いたり動かなかったりで四苦八苦中。
サブのノートPCで表題のエラーが出たので対応。

参考: Allow user to define if the box_url is insecure #1712

boxにbento/ubuntu-16.04を指定し、初めてvagrant upを実行してみると下記エラー。

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'bento/ubuntu-16.04' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
The box 'bento/ubuntu-16.04' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Vagrant Cloud, 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://vagrantcloud.com/bento/ubuntu-16.04"]
Error: SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle" of Certificate Authority (CA) public keys (CA cets). 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.
HTTPS-proxy has similar options --proxy-cacert and --proxy-insecure.

Vagrantfileの中の「config.vm.box = “bento/ubuntu-16.04″」の直下に下記を記載し再度vagrant upを実行。

config.vm.box_download_insecure = true

これで無事boxのダウンロードを開始してくれた。