A workaround for the SSL certificate problem while deploying vagrant boxes

I recently ran into the SSL certificate problem while I was deploying a vagrant box in my lab. One of the easiest ways to deploy a vagrant box is to fetch the box directly form a third party website. This initializes and brings up the box on a local providers such as Oracle virtualbox or VMware workstation. It is a method that works when there is direct connectivity to the internet from the host running vagrant.

This issue can be overcome by using an –insecure option if one is downloading the box directly and then planning to initialize it later. The command to do that is :

$ vagrant box add <vag-box>  https://insecureserver.com/vagbox.box –insecure

This does not work in case of running a command : $ vagrant init  insecureserver/<vag-box>; vagrant up –provider virtualbox.

It throws an error like shown below

Vagrant cert error 1

One of the ways to workaround this issue is to run the command, then go to the folder where the vagrantfile is created for this particular box and then edit it to include the below line.

config.vm.box_download_insecure = true

Vagrant cert error 2

Now go back and run the vagrant init command, and the issue goes away. Of course, you will see an error that says a vagrantfile already exists for the particular box.

To get around this you can just use a vagrant up command as the file is already created in the previous step. This is how I got around the SSL certificate issue. Would love to hear if there is a better way to deal with this issue

838 total views, 2 views today

Abhilash B

Abhilash is a wannabe geek who tries his hand at everything interesting. Partial DevOps guy, a little bit of SEO nerd and a VMware vExpert. Cloud consultant by day. Blogger by night. A virtualization lover who is recognized as #PernixPro and a #CiscoChampion for his contributions at VMTN community and here at vPirate.in.

Leave a Reply