From af66f5f93070639b5b4a2f42b627d7a323afed89 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 20 Jul 2013 00:18:02 -0400 Subject: [PATCH] box_download_insecure to not validate https of box_url [GH-1712] --- CHANGELOG.md | 2 ++ lib/vagrant/action/builtin/handle_box_url.rb | 2 ++ plugins/kernel_v2/config/vm.rb | 3 +++ 3 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a3cb7887..924af50ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ FEATURES: - `vagrant help ` now works. [GH-1578] + - Added `config.vm.box_download_insecure` to allor the box_url setting + to point to an https site that won't be validated. [GH-1712] IMPROVEMENTS: diff --git a/lib/vagrant/action/builtin/handle_box_url.rb b/lib/vagrant/action/builtin/handle_box_url.rb index 1f2b61589..87b707e7b 100644 --- a/lib/vagrant/action/builtin/handle_box_url.rb +++ b/lib/vagrant/action/builtin/handle_box_url.rb @@ -38,6 +38,7 @@ module Vagrant # raise a terrible runtime error. box_name = env[:machine].config.vm.box box_url = env[:machine].config.vm.box_url + box_download_insecure = env[:machine].config.vm.box_download_insecure lock.synchronize do # First see if we actually have the box now. @@ -60,6 +61,7 @@ module Vagrant begin env[:action_runner].run(Vagrant::Action.action_box_add, { + :box_download_insecure => box_download_insecure, :box_name => box_name, :box_provider => box_formats, :box_url => box_url diff --git a/plugins/kernel_v2/config/vm.rb b/plugins/kernel_v2/config/vm.rb index c6d50bf5c..f8953d419 100644 --- a/plugins/kernel_v2/config/vm.rb +++ b/plugins/kernel_v2/config/vm.rb @@ -16,6 +16,7 @@ module VagrantPlugins attr_accessor :base_mac attr_accessor :box attr_accessor :box_url + attr_accessor :box_download_insecure attr_accessor :graceful_halt_retry_count attr_accessor :graceful_halt_retry_interval attr_accessor :guest @@ -24,6 +25,7 @@ module VagrantPlugins attr_reader :provisioners def initialize + @box_download_insecure = UNSET_VALUE @graceful_halt_retry_count = UNSET_VALUE @graceful_halt_retry_interval = UNSET_VALUE @guest = UNSET_VALUE @@ -230,6 +232,7 @@ module VagrantPlugins def finalize! # Defaults + @box_download_insecure = false if @box_download_insecure == UNSET_VALUE @guest = nil if @guest == UNSET_VALUE @hostname = nil if @hostname == UNSET_VALUE