Merge pull request #69 from chef/ssl-conf

Merged change 6e7e1018-d9b0-49da-a9f1-0688057c715d

From review branch ssl-conf into master

Signed-off-by: chartmann <chartmann@chef.io>
This commit is contained in:
chef-delivery 2015-10-05 04:21:31 -07:00
commit d030aa8536
3 changed files with 8 additions and 7 deletions

View file

@ -65,10 +65,10 @@ class VulcanoCLI < Thor
desc: 'Specify a sudo password, if it is required.' desc: 'Specify a sudo password, if it is required.'
option :sudo_options, type: :string, default: '', option :sudo_options, type: :string, default: '',
desc: 'Additional sudo options for a remote scan.' desc: 'Additional sudo options for a remote scan.'
option :winrm_self_signed, type: :boolean, default: false, option :ssl, type: :boolean, default: false,
desc: 'Allow remote scans with WinRM to run on self-signed certificates.' desc: 'Use SSL for transport layer encryptiong (WinRM).'
option :winrm_ssl, type: :boolean, default: false, option :self_signed, type: :boolean, default: false,
desc: 'Configure WinRM scans to run via SSL instead of pure HTTP.' desc: 'Allow remote scans with self-signed certificates (WinRM).'
end end
desc 'exec PATHS', 'run all test files' desc 'exec PATHS', 'run all test files'

View file

@ -38,7 +38,8 @@ module Vulcano::Backends
when 'ssh' when 'ssh'
spec_backend = Specinfra::Backend::Ssh spec_backend = Specinfra::Backend::Ssh
backend_helper = Ssh backend_helper = Ssh
when 'winrm' when 'winrm', 'winrms'
@conf['ssl'] = true if type == 'winrms'
spec_backend = Specinfra::Backend::Winrm spec_backend = Specinfra::Backend::Winrm
backend_helper = Winrm backend_helper = Winrm
else else

View file

@ -10,7 +10,7 @@ class Vulcano::Backends::SpecinfraHelper
fail 'You must configure a target host.' if host.empty? fail 'You must configure a target host.' if host.empty?
# SSL configuration # SSL configuration
if conf['winrm_ssl'] if conf['ssl']
scheme = 'https' scheme = 'https'
port ||= 5986 port ||= 5986
else else
@ -47,7 +47,7 @@ class Vulcano::Backends::SpecinfraHelper
user: user, user: user,
pass: pass, pass: pass,
basic_auth_only: true, basic_auth_only: true,
no_ssl_peer_verification: conf['winrm_self_signed'], no_ssl_peer_verification: conf['self_signed'],
) )
si.winrm = winrm si.winrm = winrm
end end