Vagrant: Vagrantfile and insecure option (certificate issue)

Created on 1 Jul 2013  ·  3Comments  ·  Source: hashicorp/vagrant

Hello!

I wrote Vagrantfile which downloads my custom box via httpS.
It is possible for me to call vagrant box add --insecure ... but I can't find any way to ignore certifacte through Vagrantfile.
When I share my Vagrantfile and developer asks vagran up he gets errors:

Downloading or copying the box...
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

SSL certificate problem: self signed certificate
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.

Is it possible to add some kind of config.vm.box_download_insecure = true option?

Most helpful comment

I found the only solution for me so far is to open the following file:
C:\HashiCorp\Vagrant\embedded\gems\2.0.3\gems\vagrant-2.0.3\lib\vagrant\util\downloader.rb

Modify the curl options (towards the bottom of the file:

# options << "--insecure" if @insecure
options << "--insecure"

All 3 comments

Dup of #1712

I found the only solution for me so far is to open the following file:
C:\HashiCorp\Vagrant\embedded\gems\2.0.3\gems\vagrant-2.0.3\lib\vagrant\util\downloader.rb

Modify the curl options (towards the bottom of the file:

# options << "--insecure" if @insecure
options << "--insecure"

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Cbeck527 picture Cbeck527  ·  3Comments

doomnuggets picture doomnuggets  ·  3Comments

janw-me picture janw-me  ·  3Comments

RobertSwirsky picture RobertSwirsky  ·  3Comments

lebogan picture lebogan  ·  3Comments